I have the issue of getting the records out of database in the specific condintion. I have table 'test' I want to get the listing from sorted by driverid and table 'drivers' which i use to adjust sorting of the listing from 'test' table.
My query:
SELECT * FROM test JOIN drivers ON test.driverid=drivers.driverid ORDER BY queno
Table 'drivers' looks like:
driver | driverid | queno
-------------------
drv1 | 15 | 3
drv2 | 30 | 1
drv3 | 40 | 2
Problem is when there is no value assigned to 'driverid' in 'test' table then these results are listed at very beginning. I would like to have these listed at the end
How to achieve that? Thx in advance!