Jump to content

[SOLVED] Trying to use "in" shortcut it's giving me zero returned but long way works?


tyweed

Recommended Posts

I'm completely confused as to why this is not working? I have a comma seperated list of variables i check using the in shortcut vs having to list multiple or's.

 

============== table example query================

          id user_id groupname

1 1 test

2 3 test

        3 2 test

23 1 thisisnew

        22 10 test

=============================================

Select user_id from user_id_groupname where groupname in ('test,thisisnew')

 

is returning zero?

 

but

Select user_id from user_id_groupname where groupname='test' or groupname='thisisnew'

 

returns: The corret response

user_id

1

3

2

1

10

 

 

 

I have no idea what is heppening I though in is just a shorthand for testing multiple or's?

 

whats going on?

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.