On Nov 12, 2009, at 7:29 PM, Lynn Manhart wrote:
> select * in customers where position ('sub_string' in 'text_column')
> > 0;
If you really have single quotes around the name of your text column,
position is looking for your string in that literal text. It should
not have single quotes. If your column name is a reserved word or has
special characters you can double quote it.
I also think you want select * "FROM" not "IN", so
SELECT * FROM customers WHERE position('sub_string' in
customers_text_column) > 0;
> Another question - how are upper and lower case handled when using
> "order by"? In my experimenting, it seems to be doing a case
> insensitive compare, but the docs I've read seem to indicate
It depends on the locale settings when the cluster was created. On US
systems, typically uppercase precedes lowercase. E.g. "Zip" is before
"apple" in an ascending sort.
John DeSoi, Ph.D.
In response to
pgsql-novice by date
|Next:||From: Jasen Betts||Date: 2009-11-16 07:50:51|
|Subject: Re: using position in where|
|Previous:||From: Lynn Manhart||Date: 2009-11-13 00:29:18|
|Subject: using position in where|