Re: [SQL] trying to pattern match to a value contained in a column

2000-12-09 Thread Bruce Momjian
> Beth Gatewood <[EMAIL PROTECTED]> writes: > > I hope this isn't because I am using 6.3 (yes...I know it is very very > > old but this is currently where the data is!) > > > here is the query: > > select * from av34s1 where chromat ~~ ('%' || sample || '%'); > > ERROR: parser: syntax error at o

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Ross J. Reedstrom
Beth - Both errors you describe are due to using 6.3. The first one might work if you parenthize the repeated use of ||, as so: select * from av34s1 where chromat ~~ (('%' || sample ) || '%'); Ross On Thu, Dec 07, 2000 at 01:45:00PM -0800, Beth Gatewood wrote: > Hi Francis- > > Thank you for

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Tom Lane
Beth Gatewood <[EMAIL PROTECTED]> writes: > I hope this isn't because I am using 6.3 (yes...I know it is very very > old but this is currently where the data is!) > here is the query: > select * from av34s1 where chromat ~~ ('%' || sample || '%'); > ERROR: parser: syntax error at or near "||" I

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Joel Burton
> This makes perfect sense...unfortunately it isn't working... > > I hope this isn't because I am using 6.3 (yes...I know it is very very > old but this is currently where the data is!) > > here is the query: > > select * from av34s1 where chromat ~~ ('%' || sample || '%'); > > > ERROR: pars

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Peter Eisentraut
Beth Gatewood writes: > So-If I had a table where I had LONG_NAME and ABBR as attributes. > > I want something like > > SELECT whatever FROM my_table WHERE long_name LIKE '%[the value of ABBR > in that row]%'; SELECT whatever FROM my_table a, my_table b WHERE a.long_name like (b.abbr || '%'); -

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Beth Gatewood
#x27;||' is the string-concatenation operator. > > Hope this helps > > Francis Solomon > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]On Behalf Of Beth Gatewood > > Sent: 07 December 2000 21:06 > > To: [EMA

RE: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Francis Solomon
> From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Beth Gatewood > Sent: 07 December 2000 21:06 > To: [EMAIL PROTECTED] > Subject: [SQL] trying to pattern match to a value contained > in a column > > > Hi- > > I can't figure out how to do this

[SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Beth Gatewood
Hi- I can't figure out how to do this I examine a table where I think that one attribute is an abbreviation of another attribute. So-If I had a table where I had LONG_NAME and ABBR as attributes. I want something like SELECT whatever FROM my_table WHERE long_name LIKE '%[the value of ABBR