RE: WHERE-ing an alias...

2002-06-06 Thread Ian M. Evans
[snip] WHERE ap_type='Original Movie Poster' ORDER BY sort_title ASC HAVING sort_title LIKE 'G%' ORDER BY sort_title ASC You may have to swap the HAVING and ORDER BY lines of the query, [/snip] Thanks so much. There was a slight syntax change, replacing your first ORDER BY with a GROUP BY, but

RE: WHERE-ing an alias...

2002-06-05 Thread Jay Blanchard
[snip] SELECT posterdata.*, IF (aptitle LIKE 'The %',SUBSTRING(aptitle,5),IF (aptitle LIKE 'A %',SUBSTRING(aptitle,3),IF (aptitle LIKE 'An %',SUBSTRING(aptitle,4),aptitle))) AS sort_title FROM posterdata WHERE ap_type='Original Movie Poster' AND sort_title LIKE 'G%' ORDER BY sort_title ASC As

Re: WHERE-ing an alias...

2002-06-05 Thread Keith C. Ivey
On 5 Jun 2002, at 14:30, Ian M. Evans wrote: As per previous suggestions, I use sort_title so that film titles like The Godfather get sorted as Godfather. In the above select I was trying to narrow the search down so I could grab all the films that started with 'G' but still using the