Re: [GENERAL] select * from users where user_id NOT in (select

2006-08-18 Thread Alexander Farber
Hello, thank you and sorry for asking a FAQ. I've fixed my problem now by: select user_id, username from phpbb_users where user_id not in (select ban_userid from phpbb_banlist where ban_userid is not null); but still your explanation feels illogical to me even though I know you're right... On

Re: [GENERAL] select * from users where user_id NOT in (select

2006-08-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-08-18 10:00:20 +0200: On 8/18/06, Stephan Szabo [EMAIL PROTECTED] wrote: When the subselect returns NULL for at least one row, you fall into this sort of case. x NOT IN (...) is equivalent to NOT(x IN (...)) which is NOT(x = ANY (...)) x = ANY (...) is

[GENERAL] select * from users where user_id NOT in (select ban_userid from banlist)

2006-08-17 Thread Alexander Farber
Hello, I have this strange problem that the following statement works: phpbb= select user_id, username from phpbb_users phpbb- where user_id in (select ban_userid from phpbb_banlist); user_id | username -+-- 3 | La-Li (1 row) But the negative one returns nothing:

Re: [GENERAL] select * from users where user_id NOT in (select

2006-08-17 Thread Stephan Szabo
On Thu, 17 Aug 2006, Alexander Farber wrote: I have this strange problem that the following statement works: NULLs are not your friends. :( phpbb= select user_id, username from phpbb_users phpbb- where user_id in (select ban_userid from phpbb_banlist); user_id | username

Re: [GENERAL] select * from users where user_id NOT in (select

2006-08-17 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Thu, 17 Aug 2006, Alexander Farber wrote: But the negative one returns nothing: phpbb= select user_id, username from phpbb_users phpbb- where user_id not in (select ban_userid from phpbb_banlist); user_id | username -+-- (0 rows)