pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Techoueyres <tom@eurobase.net>
To: pgsql-sql@postgresql.org
Subject: A search SQL query
Date: Thu, 2 Dec 1999 15:51:51 -0500
Message-ID: <002f01bf3d07$0f27df80$157999cf@eurobase.net> (raw)

Hi,

I am using a cursor search using sql queries to get information from a
database that has 5 fields. The search is done on one of the fields which
are "electronic components parts".
My users usually type in the all part number they are looking for in the
form.
Here is the situation I have, lets say that a user is looking for part
'LM741CN-SGS', I have the follwoing queries:
- select * from inventory where partno like 'LM741CN-SGS'  (exact search)
- select * from inventory where partno like 'LM741CN-SGS%' (partial search)
- select * from inventory where partno like '%LM741CN-SGS%' (extended
search)

Now I need to create a query that when the user looks for 'LM741CNSGS', the
result comes back with all rows with 'LM741CN-SGS' and and all rows with
'LM741CNSGS'.
What would the suggested sql query to provide that type of result?

I would appreciate any feedback.

Thank you,

Tom Techoueyres
tom@eurobase.net




view thread (6+ messages)  latest in thread

Message-ID: <002f01bf3d07$0f27df80$157999cf@eurobase.net>
Permalink:  ../002f01bf3d07$0f27df80$157999cf@eurobase.net/
Also on:    postgresql.org/message-id/002f01bf3d07$0f27df80$157999cf@eurobase.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tom@eurobase.net
  Subject: Re: A search SQL query
  In-Reply-To: <002f01bf3d07$0f27df80$157999cf@eurobase.net>
  References: <002f01bf3d07$0f27df80$157999cf@eurobase.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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