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 pl sql procedure have a return statement?
How do you change a value in sql?
Explain the components of sql?
What company owns postgresql?
What is sql clause?
Is primary key a clustered index?
What is the difference between delete and truncate statement in sql?
What is union, minus and interact commands?
What is before and after trigger?
Do ddl statements need commit?
When are we going to use truncate and delete?
Differentiate between % rowtype and type record.
Is ms sql is free?
how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba
What is a left join?