i have a table like
from to distance Bangalore Hyderabad 1000 Hyderabad Bangalore 1000
here Hyderabad to Bangalore and Bangalore to Hyderabad both are having same distance.so i want first record if the data comes like this...
You could just write a simple where clause which defines your need.
Eg: select distance from TABLE_NAME where ( ("from" = 'Bangalore' and "to" = 'Hyderabad') or ("from" = 'Hyderabad' and "to" ='Bangalore') ) and rownum <= 1