Skip site navigation (1) Skip section navigation (2)

using position in where

From: "Lynn Manhart" <ManhartL(at)mstarmetro(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: using position in where
Date: 2009-11-13 00:29:18
Message-ID: 3C9F1C6915B24766B3BC396CA04A93C0@LynnPC (view raw or flat)
Thread:
Lists: pgsql-novice
I have an application where I need to "select" based on whether or not a 
"text" column value contains a given substring. I have tried the "position" 
function as follows, but it doesn't return anything:

select * in customers where position ('sub_string' in 'text_column') > 0;

Is there another way to do this?

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 otherwise.

Thanks in advance,
Lynn


In response to

Responses

pgsql-novice by date

Next:From: John DeSoiDate: 2009-11-13 03:57:42
Subject: Re: using position in where
Previous:From: Tom LaneDate: 2009-11-12 15:15:57
Subject: Re: How to change primary key in a table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group