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
What is sql profiler in oracle?
What is before and after trigger?
What is scalar function in sql?
Why is partition used in sql?
How many types of indexes are there in sql?
What is primary key and foreign key?
What is a .db file?
What are the different type of joins in sql?
What are variables in pl sql?
What are the main features of cursor?
What is a record in pl/sql?
What is transaction control language (tcl)?
What is native sql query?
How does index help in query performance?
What is information schema in sql?