mysql - Select sql query not working -


started solving problems given on sqlzoo.net http://sqlzoo.net/wiki/select_from_nobel_tutorial

the 8th question given on tutorial has been solved before on page simple select sql query not working in extensive detail don't understand why answer incorrect , giving me wrong results.

my query:

    select distinct yr      (select distinct yr, subject nobel subject!='chemistry')x     subject='physics' 

can please explain why query not correct?

change != <>.

edit: removing x isn't necessary, it's acting table alias. fix make more clear adding space and/or adding 'as'.

e.g.

(select ... ...) x  (select ... ...) x 

also, see why second clause there now. :p


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -