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 / nihar meher

select distinct greatest(source,destination),least(source,destination) from tablename;

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is record in oracle pl sql?

1017


What are the benefits of triggers?

1217


What is the maximum size of sqlite database?

1155


What is an index in sql with example?

1020


What are the two types of exceptions in pl/sql?

1090


What are inner outer left and right joins in sql?

1058


List the ways to get the count of records in a table?

942


What is the maximum number of columns in sql table?

1228


Explain character-manipulation functions?

1176


What is trigger with example?

1170


What does the argument [or replace] do?

1127


What is ttitle and btitle?

1113


Does truncate require commit?

1032


What is cascade in sql?

1017


How is pl sql different from sql?

1142