MySQL Forums
Forum List  »  Newbie

Problems with SELECT 'value' IN(field)
Posted by: hannes kannes
Date: July 19, 2005 05:04AM

Hi,

i have this problem:

SELECT * FROM table WHERE '1' IN(field)

"field" is not a var, it's a table-field and contains values like: 1,2,3

I just get a result, if "field" contains only one number

E.G.

Value of the table-field "field": 1

SELECT * FROM table WHERE '1' IN(field) <<< I get a result

Value of the table-field "field": 1,2,3

SELECT * FROM table WHERE '1' IN(field) <<< I don't get a result


What should I do, so that IN(field) also works like

SELECT * FROM table WHERE field IN(1,2)


I just want tu use it in a reverse way

WHERE value IN(field) instead of WHERE field IN(value)

(value is not an table-field, it's a var)


I hope, i expressed my problem understandable.



Greetings from germany

Options: ReplyQuote


Subject
Written By
Posted
Problems with SELECT 'value' IN(field)
July 19, 2005 05:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.