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
Why do we need cursor in pl sql?
What is an emotional trigger?
Name the operator which is used in the query for pattern matching?
What is left join in sql?
What is difference between sql and excel?
What are local and global variables and their differences?
mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql
how to drop an existing table in mysql? : Sql dba
define join and explain different type of joins? : Sql dba
what are the non-standard sql commands supported by 'mysql'? : Sql dba
Is left join same as join?
What are the 3 modes of parameter?
What are the commands used in sql?
Is a view faster than a stored procedure?
What is trigger explain it?