04pallav
9/13/2017 - 9:53 PM

Some Rules

Some Rules

1. After each subquery give its alias. subqueries are things inside one bracket

Example:
select winner,subject from (select winner,subject,1 filter from nobel where yr=1984 and subject not in ('Chemistry','Physics')
union
select winner,subject,2 filter from nobel where yr=1984 and subject in ('Chemistry','Physics')) C order by filter,subject,winner


2. We can create additional columns for fitering or sorting like above