13
Views
1
Comments
Solved
Error in Sql when use union

Hi,

I am using advance sql and using union for greeting record Counts.

but i am unable to run it getting error


Can anyone help me.


Regards

Piya

Rank: #90
Solution

Hi Piya,

whenever use Union or union all-

1. the selection of attributes  must same 

2. you are using three select query and must have same count of attribute.

in your sencond query you missed one attribute-

there is only two attributes/Columns

use 

Select count(1),'Risk',0 from {Risks}


Hope this will help you.

Regards

Rahul