English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a list of possible values that should result in a match in an oracle database. Is there a way so say something like myColumn = 1,2,4,6,8,13,19 for example or do I have to do myColumn = 1 OR myColumn = 2 OR ...?

This list can be long (a couple of hundred).

2007-11-19 00:21:26 · 4 answers · asked by Thee John Galt 3 in Computers & Internet Programming & Design

4 answers

That will be
myColumn in (1,2,4,6,8,13,19)

2007-11-19 00:25:11 · answer #1 · answered by AnalProgrammer 7 · 0 0

a million. have self belief 2. communication (had to characteristic this because of the actuality it quite is important to me) 3. pay interest to 4. Romance 5. staying potential 6. Sharing 7. Humor 8. exhilaration 9. Tenderness 10. Compatibility

2016-12-09 01:43:25 · answer #2 · answered by ? 4 · 0 0

make a set of the possible matches and then use the clause in the query as follows

myColumn in (all possible values, separated by comma)

2007-11-19 00:29:43 · answer #3 · answered by MintChoc 3 · 0 0

Here is what the code would look like :

SELECT * FROM myTable
WHERE myColumn IN (1,2,3,4,6,8,13,.......)

The 'IN' operator works great for lists such as this. You could even use a subquery for the list of values, such as

SELECT * FROM myTable
WHERE column IN (SELECT column FROM myOtherTable);

Good luck : )

2007-11-19 02:25:59 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers