CodeIgniter Forums
SQL query where in - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: SQL query where in (/showthread.php?tid=58227)



SQL query where in - El Forum - 05-25-2013

[eluser]Cosai[/eluser]
Hi,

I am newbie to CI. It seems a nice one but I have a question.

I have seen the where_in function but it searches an array so considering a query like below

Select * from users where friend_id in (select * from vip where salary<1000)

Select the users who are friends with the VIP's whose salary is less than 1000 ???

Do I have to make two queries for that query to use where_in function?

Cosai