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 / ajitnayak
select distinct source,destination,distance from dist_tab where source > destination
minus
select distinct source,destination,distance from dist_tab where source < destination
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What company owns postgresql?
What is parameter substitution in sql?
how to fetch alternate records from a table? : Sql dba
What will you get by the cursor attribute sql%notfound?
What are the two types of exceptions in pl/sql?
Why is a primary key important?
How do you go back in sql?
What is a unique key and primary key and foreign key?
Explain how to use transactions efficiently : transact sql
What are conditional predicates?
How many types of privileges are available in sql?
What is the difference between truncate and drop statements?
Is it possible to sort a column using a column alias?
Is sql workbench free?
What is benefit of creating memory optimized table?