Jaime Castells <[EMAIL PROTECTED]> wrote:
Actually, Jay, I've bumped into cases where you couldn't avoid a
nested query. Here's an example that works in SQLite:

SELECT COUNT(funky_values)
FROM (SELECT substr(locations.code, 5,9) AS funky_values FROM
locations WHERE locations.code LIKE 'B%')
WHERE funky_values LIKE '1%'
;

select count(*) from locations
where locations.code like 'B___1%';

-- or

select count(*) from locations
where locations.code like 'B%' and
   substr(locations.code, 5, 9) like '1%';

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to