hiddenpearls — 2011-11-05T06:21:21-04:00 — #1
I'm trying to remove second table entries that matches in first table but confused
here is my SQL
members.id as ID
(members.membership_accepted=1 AND members.full_membership=1)
It shows me members table with all of its entries. If i use INNER JOIN then it shows just the matches entries from both table. but don't know how I can get my required results.
r937 — 2011-11-05T06:32:28-04:00 — #2
SELECT members.id AS ID
ON membership_payments.user_id = members.id
WHERE members.membership_accepted = 1
AND members.full_membership = 1
<font color='"#0000FF"'>AND membership_payments.user_id IS NULL</font>
BY members.last_name ASC
hiddenpearls — 2011-11-05T06:39:02-04:00 — #3
Thanks it works, So I needed left outer join.
r937 — 2011-11-05T06:56:07-04:00 — #4
you already had left outer join
what you needed was the IS NULL check, to isolate those members who don't have a payment
by the way, this is called "except" not "intersect"
hiddenpearls — 2011-11-05T13:35:01-04:00 — #5
Interset will be INNER JOIN.