|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
bug with nested order bys
I am using a work around to achieve a Limit—with offset effect with sql server 7 taken from :
URL Just quickly the following sql which works with mysql: PHP Code:
Can be achieved in mssql using: PHP Code:
The strategy works well and is very fast - even when dealing with 200,000 plus records. I've just hit a problem using mssql 7 when using the workaround. mssql seems to ignore the descending order by when ordering by more than two fields. That is; something like: PHP Code:
produces the expected result. But with: PHP Code:
the second descending order by is ignored. The result of the above query is sorted by firstname, lastname asscending. Has anyone else come across this problem and know of a workaround or a patch to fix it? Any help is greatly appreciated, Andy. |
|
#2
|
|||
|
|||
|
No, you got it wrong. Desc/Asc is only applied to the preceeding column.
Code:
order by strFirstName desc, strLastName desc |
|
#3
|
|||
|
|||
|
heh - oops
feeling silly now ..Thank you! That's a life saver .. Andy. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > bug with nested order bys |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|