OK, I use bunch of ANDs and ORs in my SELECT-clause. Just because I like that style
And my original question was about code economy and efficiency - as I like that style too
I know it works like this
1. SELECT name FROM countries WHERE continent=europe AND name like 'B%'
2. SELECT name FROM countries WHERE continent=europe AND name like 'F%'
3. SELECT name FROM countries WHERE continent=europe AND name like 'M%'
but to me it seems that it would be more efficient to have it like:
1. SELECT name FROM countries WHERE continent=europe
2. SELECT name FROM result-of-1. WHERE name like 'B%'
3. SELECT name FROM result-of-1. WHERE name like 'F%'
4. SELECT name FROM result-of-1. WHERE name like 'M%'
I don't know if the difference in speed/efficiency is that of bicycle and ferrari, but still - I'm working with invoice data, containing thousands of lines. And I'd like to first search invoices with dates between 1.1.2009 - 31.12.2009 - giving me some one thousand lines only. And then perform more detailed searches from that.