Wednesday, 6 August 2014

Select 'NORTH', CUSTOMER From CUST_DTLS Where REGION = 'N' Order By CUSTOMER Union Select 'EAST', CUSTOMER From CUST_DTLS Where REGION = 'E' Order By CUSTOMER

The above is

            a) Not an error
            b) Error - the string in single quotes 'NORTH' and 'SOUTH'
            c) Error - the string should be in double quotes
            d) Error -  ORDER BY clause

(d)  Error - the ORDER BY clause. Since ORDER BY clause cannot be used in UNIONS



No comments:

Post a Comment