Home » SQL & PL/SQL » SQL & PL/SQL » Need help in query for finding search results
Need help in query for finding search results [message #185970] Fri, 04 August 2006 09:45 Go to next message
grk28
Messages: 38
Registered: June 2006
Member
Hi,

I am having a search screen where in results will be based on last_name which contains two text boxes as follows

Last_Name : _________(From Alphabet)___________(To Alphabet)

So,If i give them as 'A' and 'C' then it should display all the name starting with A,B& C.

If i give then as 'AB' and 'TE' then it should display all the names starting with 'AB' till 'TE' (First two letter being TE).

If I give them as 'ABB' and 'CATH' then it should display all the names starting with 'ABB' till 'CATH'.( As the series contains the Letter B ,it should also display all names with B till it reaches the CATH pattern ).

Hope my requirement is clear.

So,I need query for this.

Immediate help would be appreciated.

Thanks in Advance.
Re: Need help in query for finding search results [message #186039 is a reply to message #185970] Sat, 05 August 2006 01:27 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
select last_name
from   your_table
where  last_name between from_alphabet and to_alphabet
or     last_name like to_alphabet||'%'

Note: untested code
icon14.gif  Re: Need help in query for finding search results [message #186041 is a reply to message #186039] Sat, 05 August 2006 01:37 Go to previous message
amul
Messages: 252
Registered: April 2001
Location: Chennai
Senior Member
hey it worked for me.i never knew this one before...thanks frank
Previous Topic: Query help please
Next Topic: Could anyone please help me to solve this problem ?
Goto Forum:
  


Current Time: Sun Dec 04 16:31:25 CST 2016

Total time taken to generate the page: 0.06114 seconds