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
What is java sql package?
Can we use rowid as primary key?
What is pl/sql table? Why is it used?
Mention what is the use of function "module procedure" in pl/sql?
How do I truncate a sql log file?
What are the dml statements?
How do you explain an index?
What is difference between cursor and trigger?
Does inner join return duplicate rows?
Is stored procedure faster than query?
What is a constraint? Tell me about its various levels.
Which join is default?
what is denormalization. : Sql dba
Explain commit, rollback and savepoint.
What is the purpose of design view?