Total Pageviews

November 13, 2016

11/13/2016 07:55:00 AM
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
 
Related Posts Plugin for WordPress, Blogger...