Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can pl sql procedure have a return statement?

961


How do you change a value in sql?

969


Explain the components of sql?

995


What company owns postgresql?

963


What is sql clause?

998


Is primary key a clustered index?

916


What is the difference between delete and truncate statement in sql?

1011


What is union, minus and interact commands?

1215


What is before and after trigger?

896


Do ddl statements need commit?

927


When are we going to use truncate and delete?

932


Differentiate between % rowtype and type record.

1199


Is ms sql is free?

962


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

923


What is a left join?

892