hello friend. need solve order by follwing format a. street b. city c. state d. zip I'm using this code but it's not ordering what i want. SELECT * FROM test ORDER BY a, b, c, d ASC ; it's only ordering street colm. any help?
What result do you want? Ie, as long as you sort by street first, it will sort on street. Then city (if the same street is in two or more cities) and so on.
here you are trying to sort multiple colm in one single query . your query is wrong try multi-level sub query
hi, try this SELECT * FROM test ORDER BY a ASC,b ASC,c ASC,d ASC * for records with same 'a' (street) it will then sort by 'b'(city) and so on..
for example.. street a city b state e zip a street c city d state a zip c street b city c state c zip f street b city c state c zip b street a city c state c zip b street a city d state e zip a result should be street a city b state e zip a street a city c state c zip b street a city d state e zip a street b city c state c zip b street b city c state c zip f street c city d state a zip c it should be like 1st street sort. then city sort along with street then state along with street and city also same with zip ..
it should works like data street a,city b,state e,zip a street c,city d,state a,zip c street b,city c,state c,zip f street b,city c,state c,zip b street a,city c,state c,zip b street a,city d,state e,zip a result street a,city b,state e,zip a street a,city c,state c,zip b street a,city d,state e,zip a street b,city c,state c,zip b street b,city c,state c,zip f street c,city d,state a,zip c
i created a dumy table, entered your data and run my query. i got the result 100% accurate. check the attach image:-