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?

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.