Hi All,
Can anyone please tell me how we can use unions in sqr procedure. can any one send few examples. i am using 3 unions in the procedure. but it is selecting the data from the first sql and ignoring the remaining two sqls. so Can any one please give your suggestions on this. please provide some examples if you have.
| Title | Under | Posted on |
|---|---|---|
| MD5 - SHA checksum of a file. | PeopleSoft Technical | 02/07/2012 - 5:29am |
| nVision Tabular Report through PIA with prompts | PeopleSoft Technical | 02/02/2012 - 10:07pm |
| Can we create an AE to mass update Position - Jobcode data? | PeopleSoft Technical | 01/18/2012 - 3:11am |
| Pay Components on job data can be defaulted and setup based on the rules? | PeopleSoft Functional | 01/05/2012 - 4:58am |
You can use the intersect, union, and minus SQL operators in SQR queries by adding them to the SQL statement that follows the FROM and WHERE clauses.
The SELECT list for the secondary SQL statement in the union, intersect, or minus query must match the data type, number of columns, and length of columns selected in the first query. If you select string expressions or literals, make sure that the lengths of the fields in both SELECT lists are the same.
Enter the part of the SQL statement that follows the union, minus, or intersect clauses normally; that is, with commas between column names and without alias names, as shown below:
begin-select cust_num (1,1) edit 099999 co_name (,9,30) name (,+2,25) city (,+2,18) state (,+2,2) zip (,+1) edit xxxxx-xxxx from customers where state in ('OH', 'IN', 'MI') union select cust_num, co_name, name, city, state, zip from prospects where state in ('OH', 'IN', 'MI') and first_contact >= '01-JAN-88' order by 2 end-selectGive back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Post new comment