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 / deepak
select source, destination, distance from Distance_rcd where source>destination
union select destination, source, distance from Distance_rcd where source<destination
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Why is pl sql used?
What is sql*plus?
What is ttitle and btitle?
What is the basic form of sql query?
What is a column in a table?
What is sharding in sql?
What are all the ddl commands?
how to get a list of columns in an existing table? : Sql dba
What is a string data type in sql?
What does count (*) do in sql?
What is difference between mysql and postgresql?
Is oracle sql free?
Is nosql faster than sql?
What are the different ways to optimize a sql query?
What is date functions?