Jump to content

[SOLVED] Help with query


Gmunky

Recommended Posts

I want to write a query to retrieve information about users that are not in the list of userids.the list will be around 50 ids;

 

is there a much simpler way than this: select * from user where userid != 23 AND userid != 24 AND userid != 46 AND so on....

Link to comment
Share on other sites

Sure, use the NOT IN operator:

 

SELECT * FROM `user` WHERE `userid` NOT IN (23,24,46)

 

i guess there no not in operator it is the list operator when you use the IN and not i think is part of the logical operator which are and or not

Link to comment
Share on other sites

i guess there no not in operator it is the list operator when you use the IN and not i think is part of the logical operator which are and or not

 

-->> yes u may use ds....

SELECT * FROM `user` WHERE `userid` NOT IN (23,24,46)

 

 

 

who post this you just repeat my words and this is given above

SELECT * FROM `user` WHERE `userid` NOT IN (23,24,46)

 

are you HMMMMMMMMM ?????????

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.