Chris Knipe wrote:
Lo all,
What's the format for a sub query in MySQL??
I've tried the below with a few variants but I can't seem to get it
sorted...
SELECT songlist.ID AS ID,
songlist.duration AS Duration,
songlist.artist AS Artist,
songlist.title AS Title,
songlist.filename AS FileName
FROM songlist
LEFT JOIN categorylist ON songlist.ID=categorylist.songID
WHERE categorylist.categoryID=(SELECT category.ID FROM category WHERE
category.parentID='4' ORDER BY RAND() LIMIT 1)
ORDER BY songlist.filename;
This is a InnoDB Table, running on 4.0.14...
Thanks,
me
Subquery is supported in MySQL-4.1.0 and above.
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]