Jump to content

[SOLVED] Grouping MySQL


ionik

Recommended Posts

I dont understand why this isnt working here is the sql statement

 

SELECT u.username, u.userid FROM users u, roster r WHERE u.clan_member = 1 AND u.userid <> r.userid AND catid = 1 GROUP BY u.clan_member ORDER BY u.username DESC

 

what i want this to do is select all users that have clan_member = 1, but are not allready contained in the roster table....

 

table is as follows

 

users

-------------

- username STRING

- userid PRIMARY KEY

- clan_member INT

 

roster

--------------

-userid INT

-catid INT links to roster catergories

Link to comment
Share on other sites

ok...lol

 

what i need this to do is

 

Select username and userid from userid where clan_member = 1

they are not in the roster table which would be the userid for the roster table matches userid from user table and catid = 1

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.