jeudi 6 août 2015

Incorrect syntax near 'SETS'. - SQL 2005

My code:

Group BY 
  GROUPING SETS 
  ( 
        (wmsSponsorEntityName), 
        (wmsSponsorEntityPrimaryRegion), 
        (wmsProjectNameSWP) , 
        ()          
  )

I'm doing this because those three fields repeat and the other two:

w.[P2010]

w.wugCounty

differ for some wmsProjectNameSWP

wmsSponsorEntityName = ABERNATHY

wmsSponsorEntityPrimaryRegion = P

wmsProjectNameSWP = ProjectX

w.wugCounty = HARRIS and w.wugCounty = JEFFERSON

w.[P2010] = 200 and 345 (differs for each county)

But I receive an error of Incorrect syntax near 'SETS'.

Any guidance would be appreciated.

Aucun commentaire:

Enregistrer un commentaire