Jump to content

Archived

This topic is now archived and is closed to further replies.

brown2005

help please

Recommended Posts

$sql = "select * from table1 where members_id not in (select selected_id from table2 where 1)";

is this correct as i cant get it to work

Share this post


Link to post
Share on other sites
[quote]select selected_id from table2 where 1[/quote]

That isn't a valid sql query.  Aside from your subselect being jacked, it should work.

[code]SELECT * FROM table1 WHERE members_id NOT IN (SELECT selected_id FROM table2);[/code]

Share this post


Link to post
Share on other sites
SQL-query : 

SELECT *
FROM websites
WHERE websites_id NOT
IN (


SELECT websites_hits_id
FROM websites_hits
)
LIMIT 0 , 30

MySQL said:


#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT websites_hits_id
FROM websites_hits ) LIMIT 0, 30' at li

Share this post


Link to post
Share on other sites
sub selects were only added in mysql 5, check which version of mysql you have.

Also, [code]SELECT * FROM `table` WHERE 1[/code] is a valid query, try it.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.