Hi I am using a select query from front end to generate report in such a way that I should be able to get records of Table W which are present in Table Y
The query which i am using is as follows:
[CODE=oracle]Select Y.ntktno,Y.cpas sengername,Y.cf romroute,Y.cupt oroute
from t_indi_infiledt l Y,t_indi_cancfi ledtl W where Y.ntktno in
(select ntktno from t_indi_cancfile dtl) and Y.cfromroute=W. cfromroute and
Y.cuptoroute=W. cuptoroute and
soundex(substr( Y.cpassengernam e,1,5))=soundex (substr(W.cpass engername,1,5)) [/CODE]
By the above Query I am getting the desired output .
But I wants to check the minimum length of the passengername between (Y.cpassengerna me and W.cpassengernam e) and using that minimum length i wants to fire the query for the soundex function since i cant assume that soundex (Y.cpassengerna me)=soundex(W.c passengername) for the first 5 characters Instead of 1st five characters I wants to take the minimum length
How can i solve the above problem.
Should i use Decode function or Case function and how in where clause????
Can anyone help me out of the above problem
The query which i am using is as follows:
[CODE=oracle]Select Y.ntktno,Y.cpas sengername,Y.cf romroute,Y.cupt oroute
from t_indi_infiledt l Y,t_indi_cancfi ledtl W where Y.ntktno in
(select ntktno from t_indi_cancfile dtl) and Y.cfromroute=W. cfromroute and
Y.cuptoroute=W. cuptoroute and
soundex(substr( Y.cpassengernam e,1,5))=soundex (substr(W.cpass engername,1,5)) [/CODE]
By the above Query I am getting the desired output .
But I wants to check the minimum length of the passengername between (Y.cpassengerna me and W.cpassengernam e) and using that minimum length i wants to fire the query for the soundex function since i cant assume that soundex (Y.cpassengerna me)=soundex(W.c passengername) for the first 5 characters Instead of 1st five characters I wants to take the minimum length
How can i solve the above problem.
Should i use Decode function or Case function and how in where clause????
Can anyone help me out of the above problem
Comment