|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
query - order
Hi guys,
is there anyway i can put the query results in the order i want according to two values ?? Now i have a table with two columns.. one is image column and the other one is item i want to display all records according to these orders: - display the records with image first and put the records with image column empty at the bottom.. <-- this can be done be sorting the image column.. now i want to sort the records once again by their name.. thats mean items start with letter 'a' will be on top of the display.. same goes to the records that with empty image column,, but the records without any entry in the image column will be shown after records with data in image column.. do u guys get what i am trying to say.. hope u guys can understand what i wanna ask.. i want it to display something like this: e.g: joj.jpg Chair all.gif Table Bench Cup please advise.. |
|
#2
|
|||
|
|||
|
"SELECT * FROM table ORDER BY columname" or "SELECT * FROM table ORDER BY columname DESC" (desc = descending reverses the order)
hope that's what u meant.. basics of sql btw should be on http://www.w3schools.comcan also sort it by 2 values.. ORDER BY columname1, columname2.. sorts em for col1 first then the 2nd |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > query - order |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|