SQL Queries....

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Fri Oct 3 23:23:51 UTC 2003


On Thu, 2 Oct 2003, Lance F. Squire wrote:

> I've been working with some SQL driven sights. Mostly Postgres and some
> MySQL, However I've never had to do this before:
>
> Does anyone know how to select only records that start with a certain
> letter?
>
> I can easly select records that contain the letter and order them
> properly, but that dosn't help much. :(

Look into regular expressions and the ~ match operator. Eg:

yada yada WHERE '^q' ~ my_favorite_column;

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list