Help on SQL statement# Database - 数据库
C*n
1 楼
Hello,
I have a table, has:
ProductID, Price, CreateDate
I need to create a view, has:
ProductID, LatestPriceof1999,Latestpriceof2000,Latestpriceof2001
Latestpriceof1999 means the latest price in year 1999.
Assume there're only data for 1999,2000,2001.
Who can help me out?
Note: I am creating a view, if you come up with a stored procedure
solution, don't answer.
If you Select statement is more than 2 pages, don't answer.
Demo Data:
1 1
I have a table, has:
ProductID, Price, CreateDate
I need to create a view, has:
ProductID, LatestPriceof1999,Latestpriceof2000,Latestpriceof2001
Latestpriceof1999 means the latest price in year 1999.
Assume there're only data for 1999,2000,2001.
Who can help me out?
Note: I am creating a view, if you come up with a stored procedure
solution, don't answer.
If you Select statement is more than 2 pages, don't answer.
Demo Data:
1 1