A search SQL query - Mailing list pgsql-sql

From Tom Techoueyres
Subject A search SQL query
Date
Msg-id 002f01bf3d07$0f27df80$157999cf@eurobase.net
Whole thread Raw
Responses Re: [SQL] A search SQL query  (<kaiq@realtyideas.com>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "Zot O'Connor"
Date:
Subject: PHP/Postgres dieing in random but consistent place.
Next
From:
Date:
Subject: Re: [SQL] A search SQL query