0ne Posted June 28, 2009 Share Posted June 28, 2009 How to use that request correctly? SELECT a.login_id, (SELECT * from details d WHERE d.reff=a.login_id) FROM login a I want 2nd SELECT to use login_id field from the 1st SELECT. How can I do this? Quote Link to comment https://forums.phpfreaks.com/topic/164011-dont-know-how-to-use-select-correctly/ Share on other sites More sharing options...
dzelenika Posted June 28, 2009 Share Posted June 28, 2009 SELECT * from details d WHERE d.reff=(SELECT login_id FROM FROM login WHERE ...) Quote Link to comment https://forums.phpfreaks.com/topic/164011-dont-know-how-to-use-select-correctly/#findComment-865209 Share on other sites More sharing options...
fenway Posted June 30, 2009 Share Posted June 30, 2009 Use a JOIN. Quote Link to comment https://forums.phpfreaks.com/topic/164011-dont-know-how-to-use-select-correctly/#findComment-866646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.