mysql - SELECT column1 FROM table WHERE column2 is greater than column1 -


sample table

i want display values of column greater equivalent value in row

like example, display country name population greater country name (i.e. andorra)

select name country population > population (of andorra) 

you can use subquery this, e.g.:

select name country population > (    select population    country     name = 'andorra' ); 

please note query return error if

  • there no record name country name 'andorra' or
  • there more 1 record country name 'andorra'

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -