Hello:
I'm trying to get a record from mysql based on the query of another
the queries separately:
set @row_num = 0; SELECT @row_num := @row_num + 1 as row_number,queue_num,clientID,customerid, todays_date, request, details,status FROM queue_sys
ORDER BY todays_date;
outputs
row_number queue_num clientID customerid todays_date request details status
1 14 44DWS 63097 2012-06-15 07:44:59 A/C-Heater Controls asfaf drop-off
2 15 V8MONST SB3434 2012-06-15 07:45:40 Anti-Lock Systems ,Brake Drums 2323 waiting
3 16 342DF Bs6444 2012-06-15 08:00:03 Oil Change sadasd drop-off
second query
SELECT * FROM queue_sys ORDER BY clientID DESC LIMIT 1;
How can run both queries in one sql to output:
3 16 342DF Bs6444 2012-06-15 08:00:03 Oil Change sadasd drop-off
I have tried the following with no success.
SELECT * FROM (set @row_num = 0; SELECT @row_num := @row_num + 1 as row_number,queue_num,clientID,customerid, todays_date, request, details,status FROM queue_sys
ORDER BY todays_date)ORDER BY clientID DESC LIMIT 1;
Thanks!