Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-08-27 : 07:43:44
|
| When I tried to create view using this statement:SELECT id, int1, date1FROM sprintcalibrationrequestUNION ALLSELECT id, int2, date2FROM sprintcalibrationrequestUNION ALLSELECT id, int3, date3FROM sprintcalibrationrequestORDER BY id DESCI'm getting a message:The ORDER BY clause is invalid in views, inline functions, derived tables, unless TOP is also specified.What's the problem? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-27 : 07:46:13
|
| as suggested you need TOP clause if you want to use ORDER BY. In fact you dont need ORDER BY in your view at all. just use ORDER BY only while retrieveing data from it likeSELECT * from View ORDER BY field |
 |
|
|
|
|
|