Total Pageviews

November 12, 2016

11/12/2016 06:25:00 PM
Oracle SQL Sub query

Oracle SQL :TIPS

Problem
Need to hard code two values 'A' and 'B' in my query 
I did 
Select Year, Name, Sales, 'A,B' from Emp_Table. 
I get one single row for A,B but I need two rows, one with value 'A' and another with 'B' 

Solution:
Select Year, Name, Sales, 'A' from Emp_Table 
UNION 
Select Year, Name, Sales, 'B' from Emp_Table 

For more information on SQL Topics
>>>>>Click Here

0 comments:

Post a Comment