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 is the advantage of nosql?
Define concurrency control. : Transact sql
What is sql architecture?
Explain the advantages and disadvantages of stored procedure?
in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.
Is primary key is clustered index?
How do I debug a stored procedure?
What are tables and fields?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
How to fetch values from testtable1 that are not in testtable2 without using not keyword?
Can we join 3 tables in sql?
What are the ddl commands?
What is primary key and foreign key with example?
Why is sql better than hql?
The select into statement is most often used to create backup copies of tables or for archiving records?