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 / nihar meher
select distinct greatest(source,destination),least(source,destination) from tablename;
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Is record in oracle pl sql?
What are the benefits of triggers?
What is the maximum size of sqlite database?
What is an index in sql with example?
What are the two types of exceptions in pl/sql?
What are inner outer left and right joins in sql?
List the ways to get the count of records in a table?
What is the maximum number of columns in sql table?
Explain character-manipulation functions?
What is trigger with example?
What does the argument [or replace] do?
What is ttitle and btitle?
Does truncate require commit?
What is cascade in sql?
How is pl sql different from sql?