pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
using like
5+ messages / 2 participants
[nested] [flat]

* using like
@ 1999-05-25 20:13  JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>
  0 siblings, 1 reply; 5+ messages in thread

From: JT Kirkpatrick @ 1999-05-25 20:13 UTC (permalink / raw)
  To: 'pgsql-sql@hub.org' <pgsql-sql@hub.org>

i'm trying to query my database (6.4.2 through odbc ms access) to find all 
records matching a "like" statement.  from psql i am trying this -- select 
autoinv, company from table1 where company like 'Alice'; -- but it doesn't 
work!  i could run whatever works in psql as a passthrough query in 
access97, if i could get it to work in psql!  i'd expect the query to pull 
values of company that = "Alice w." "Alice Higgins" "Alicexxxxxxx" 
"xxxxAlice..xxx", and you get the idea.

TIA for any help!  jt



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* using like
@ 1999-05-25 20:17  JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>
  0 siblings, 1 reply; 5+ messages in thread

From: JT Kirkpatrick @ 1999-05-25 20:17 UTC (permalink / raw)
  To: 'pgsql-sql@hub.org' <pgsql-sql@hub.org>

ok, sorry for conjestion, but i figured it out:  select autoinv, company 
from table1 where company like '%Alice%'; -- that works in psql.  but how 
do i substitute "Alice" with a variable name??



i'm trying to query my database (6.4.2 through odbc ms access) to find all 
records matching a "like" statement.  from psql i am trying this -- select 
autoinv, company from table1 where company like 'Alice'; -- but it doesn't 
work!  i could run whatever works in psql as a passthrough query in 
access97, if i could get it to work in psql!  i'd expect the query to pull 
values of company that = "Alice w." "Alice Higgins" "Alicexxxxxxx" 
"xxxxAlice..xxx", and you get the idea.

TIA for any help!  jt



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: [SQL] using like
@ 1999-05-25 20:37  JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>
  0 siblings, 0 replies; 5+ messages in thread

From: JT Kirkpatrick @ 1999-05-25 20:37 UTC (permalink / raw)
  To: 'Brett W. McCoy' <bmccoy@lan2wan.com>; JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>; +Cc: 'pgsql-sql@hub.org' <pgsql-sql@hub.org>

ahh, sorry again for conjestion on the list!  i have parameter criteria 
defined in an msaccess97 query, so when i run the query, it asks me for a 
value.  i since learned that i can put those wildcards (%) in the value i 
type in when access asks for it!  also, in the query definition (access97, 
not a passthrough. . .) i can also convert the field to uppercase and 
convert the user-input value (criteria expression) to uppercase so the 
search isn't case-sensitive!  it just gets cooler. . .

jt

-----Original Message-----
From:	Brett W. McCoy [SMTP:bmccoy@lan2wan.com]
Sent:	Tuesday, May 25, 1999 7:46 PM
To:	JT Kirkpatrick
Cc:	'pgsql-sql@hub.org'
Subject:	Re: [SQL] using like

On Tue, 25 May 1999, JT Kirkpatrick wrote:

> ok, sorry for conjestion, but i figured it out:  select autoinv, company
> from table1 where company like '%Alice%'; -- that works in psql.  but how 
> do i substitute "Alice" with a variable name??

A variable name where?  In AccessBasic?

Brett W. McCoy
                                         http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
Never put off till tomorrow what you can avoid all together.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [SQL] using like
@ 1999-05-25 23:43  Brett W. McCoy <bmccoy@lan2wan.com>
  parent: JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Brett W. McCoy @ 1999-05-25 23:43 UTC (permalink / raw)
  To: JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>; +Cc: 'pgsql-sql@hub.org' <pgsql-sql@hub.org>

On Tue, 25 May 1999, JT Kirkpatrick wrote:

> i'm trying to query my database (6.4.2 through odbc ms access) to find all 
> records matching a "like" statement.  from psql i am trying this -- select 
> autoinv, company from table1 where company like 'Alice'; -- but it doesn't 
> work!  i could run whatever works in psql as a passthrough query in 
> access97, if i could get it to work in psql!  i'd expect the query to pull 

You need to use the wildcard for like clauses, which is % in pgsql, but 
Access uses '*':

select autoinv, company from table1 where company like '%Alice%';

Brett W. McCoy           
                                         http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
You probably wouldn't worry about what people think of you if you could
know how seldom they do.
		-- Olin Miller.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [SQL] using like
@ 1999-05-25 23:45  Brett W. McCoy <bmccoy@lan2wan.com>
  parent: JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Brett W. McCoy @ 1999-05-25 23:45 UTC (permalink / raw)
  To: JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>; +Cc: 'pgsql-sql@hub.org' <pgsql-sql@hub.org>

On Tue, 25 May 1999, JT Kirkpatrick wrote:

> ok, sorry for conjestion, but i figured it out:  select autoinv, company 
> from table1 where company like '%Alice%'; -- that works in psql.  but how 
> do i substitute "Alice" with a variable name??

A variable name where?  In AccessBasic?

Brett W. McCoy           
                                         http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
Never put off till tomorrow what you can avoid all together.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~1999-05-25 23:45 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-05-25 20:13 using like JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>
1999-05-25 23:43 ` Brett W. McCoy <bmccoy@lan2wan.com>
1999-05-25 20:17 using like JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>
1999-05-25 23:45 ` Brett W. McCoy <bmccoy@lan2wan.com>
1999-05-25 20:37 RE: [SQL] using like JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox