Jump to content

inversing a selection when joining tables


boonamera

Recommended Posts

table 1 (users)
userid
username

table 2(payments)
paymentid
userid

I need two things
USERIDS of those who PAID. This works:
SELECT u.userid FROM users u JOIN payments ON u.userid = payments.userid;

USERIDS of those who haven't paid. This is my problem
I tried something along the lines of: but no luck
SELECT u.userid FROM users u LEFT JOIN payments ON u.userid = payments.userid LIMIT 99999 OFFSET ("SELECT ( (SELECT COUNT(*) FROM users)-(SELECT COUNT(*) FROM payments) ));
but no luck

anyone have an idea?

Archived

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

×
×
  • Create New...

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.