Registered Member
|
Hi All
Can anyone give me the correct syntax for selecting multiple values from a single column in a table please. I have Googled for it but can get nothing to work!! I have a field in my Database called 'StatusText' that can have one of several values. I can select for one value but what is the Syntax for multiple values? IE what I want is something like this -
But this (and other variations) just gives me errors. Thanks for any help. |
Moderator
|
Hi Ian.
For example: SELECT *, preffirstname, surname, statustext FROM members WHERE members.statustext = 'ACTIVE' OR members.statustext = 'PENDING' OR members.statustext = 'JOINT' Notes for your query: - "preffirstname, surname, statustext" is redundant after "*" isn't it? - conditions can be simplified using aliases: SELECT *, members.statustext AS s FROM members WHERE s = 'ACTIVE' OR s = 'PENDING' OR s = 'JOINT' - "members.statustext IN (.., .., ..)" would be possible in future Kexi. |
Registered Member
|
Thanks Jaslaw
That worked perfectly!! |
Moderator
|
Good, in such cases could you please click "Accept this answer" above? Thanks.
|
Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]