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 offset in sql query?
What is database white box testing and black box testing?
Define SQL and state the differences between SQL and other conventional programming Languages?
What is normalisation and its types?
How do I pipe the output of one isql to another?
What has stored procedures in sql and how we can use it?
What is a memo field?
How is a process of pl/sql compiled?
Why trigger is used in sql?
Why is normalization important?
What is the size of partition table?
what are the different tables present in mysql? : Sql dba
Can you have more than one key in a database?
What are the query optimization techniques?
How do you write a subquery?