source destination distance
chennai bangalore 500
bangalore chennai 500
hyd delhi 1000
delhi hyd 1000
bangalore hyd 800
Here chennai to bangalore and bangalore to chennai is same distance. and hyd and delhi also same criteria.
Based on the distance i want to display only one row using sql query?
Answer Posted / ajitnayak
select distinct source,destination,distance from dist_tab where source > destination
minus
select distinct source,destination,distance from dist_tab where source < destination
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can %notfound return null after a fetch?
What has stored procedures in sql?
How many types of privileges are available in sql?
Is it possible to create the following trigger: before or after update trigger for each row?
What are the parameter modes supported by pl/sql?
explain what is mysql? : Sql dba
How does left join work in sql?
Differentiate between pl/sql and sql?
How do you select unique values in sql?
Explain the steps needed to create the scheduled job?
What is difference between function and trigger?
what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba
How many clustered indexes can be created on a table?
Is sql database free?
What are the syntax and use of the coalesce function?