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 / deepak

select source, destination, distance from Distance_rcd where source>destination
union select destination, source, distance from Distance_rcd where source<destination

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I make sql query run faster?

1018


What is sqlca in db2?

975


How is debugging done?

989


Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?

1102


Is inner join faster than left join?

1197


how many ways to get the current time? : Sql dba

1012


What is interval partition?

1061


Can a trigger call a stored procedure?

1077


Does access use sql?

1048


What are the benefits of pl sql?

1127


Is record in pl sql?

984


How do I write a sql query in pgadmin 4?

996


Mention what plvcmt and plvrb does in pl/sql?

1148


Does pl/sql support create command?

1124


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

1198