Link to home
Start Free TrialLog in
Avatar of chris_smith_51
chris_smith_51

asked on

Getting sql values from nested statement

Hi, could someone please show me how to get the first "video_name" and "video_owner" specified by the main SELECT at the places shown by #?

SELECT video_name, video_owner FROM (SELECT * FROM requests WHERE username != 'David.young' AND video_owner != 'David.young') AS q1 WHERE EXISTS (SELECT * FROM videos WHERE name = video_name AND username = video_owner AND private = false) AND NOT EXISTS (SELECT * FROM requests WHERE username = 'David.young' AND video_name =  ##### AND video_owner = #####) GROUP BY video_name, video_owner ORDER BY COUNT(video_name) DESC LIMIT 1;
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chris_smith_51
chris_smith_51

ASKER

dammit i thought i'd tried that lol