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 %notfound return null after a fetch?

1040


What has stored procedures in sql?

1046


How many types of privileges are available in sql?

1333


Is it possible to create the following trigger: before or after update trigger for each row?

1272


What are the parameter modes supported by pl/sql?

1080


explain what is mysql? : Sql dba

1064


How does left join work in sql?

983


Differentiate between pl/sql and sql?

1129


How do you select unique values in sql?

980


Explain the steps needed to create the scheduled job?

1020


What is difference between function and trigger?

1023


what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba

1041


How many clustered indexes can be created on a table?

1067


Is sql database free?

959


What are the syntax and use of the coalesce function?

1178