Reputation: 21
I have to make a query but I'm looking for a more efficient way to do it using 'OR'.
I am currently doing it as follows.
I wonder if there's a way to not use the field name so many times to make it cleaner.
select * from the_table
where field1 = 23 or
field1 = 24 or
field1 = 43 or
field1 = 4324
Upvotes: 0
Views: 109
Reputation: 12169
That is what the IN clause is for:
select * from the_table
where field1 in (23,24,43,4324)
Upvotes: 3