ORDER BY DESC not working

Post Reply
chand012
Posts: 70
Joined: Mon Dec 18, 2000 4:34 pm

ORDER BY DESC not working

Post by chand012 »

I need to use an SQL statement of the form:

"select firstname, middlename, lastname from tbl where lastname like 'carter' order by lastname, firstname, middlename DESC"

I have normal indexes on the three name fields and a metamorph index on lastname. This command, however, does not produce the expected results, either at the command line or with WebScript. I tried creating metamorph indexes on the other name fields (just for the hell of it) but that didn't help.

What could be going wrong here?

Thanks,
David
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

ORDER BY DESC not working

Post by mark »

You probably want
order by lastname desc, firstname desc, middlename desc
chand012
Posts: 70
Joined: Mon Dec 18, 2000 4:34 pm

ORDER BY DESC not working

Post by chand012 »

User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

ORDER BY DESC not working

Post by mark »

The documentation and example on that page are correct. And states that the default ordering is ascending. It just doesn't give an example of using descending on more that one field.
chand012
Posts: 70
Joined: Mon Dec 18, 2000 4:34 pm

ORDER BY DESC not working

Post by chand012 »

OK, I get it. --David
Post Reply