searching appropriate String and return the accurate

hi

If I run the following Query

select P.ECMSKU ITEM_ID, P.ECMLDS ITEM_TITLE, 'ESH' ITEM_TYPE

from ECMMST P

where

P.ECMSTS = 'A'

AND UPPER(P.ECMLDS) LIKE UPPER('%?%');

Result:

suppose if I pass " yamaha uprirht piano"

The result set contain so many records.

I want to get reuslt like this

first search "yamaha uprirht piano"is available or not.If it is avaible display record.

If not there search the record starting with "yamaha upright".

If any one records r there display.

.If not there start "yamaha piano".suppose records r htere display .

if not there start yamaha or upright or piano.

like this i want to search.plz tell me how to solve this problem.

If u have any code plz give me.

[804 byte] By [6666a] at [2007-10-2 10:43:24]
# 1
What has this got to do with Java/Algorithms?Please stop cross-posting. http://forum.java.sun.com/thread.jspa?threadID=702376 http://forum.java.sun.com/thread.jspa?threadID=702379 http://forum.java.sun.com/thread.jspa?threadID=702380
prometheuzza at 2007-7-13 2:53:12 > top of Java-index,Other Topics,Algorithms...