Microsoft
Software
Hardware
Network
Question : COUNT_variable Error
I to have tblModellTmp with HP_4 values which represent the Sector for each company. I would like now to count how many companies are in each Sector and then in a second step, save this value for each company in HP_5 so I know for each how many competitors around. But I get already an error in my first line saying the subquery has gave back more then one value
SET @HP_4_Count = (SELECT COUNT(HP_4)FROM tblModellTmp WHERE (T = 1)GROUP BY HP_4)
UPDATE tblModellTmp
SET HP_5 = @HP_4_Count
the simble query
SELECT COUNT(HP_4) AS Expr1, HP_4
FROM tblModellTmp
WHERE (T = 1)
GROUP BY HP_4
gives back
Expr1 HP_4
78 Elektrogeräte & Bauteile
72 Freizeit, Unterhaltung, Hobbies
42 Möbel, Hausrat, Haushaltgeräte
...
Any idea how to solve?
thx
Kongta
Answer : COUNT_variable Error
sorry
UPDATE u
SET HP_5 = x.expr1
from tblmodelltmp as U
inner join (
SELECT COUNT(HP_4) AS Expr1, HP_4
FROM tblModellTmp
WHERE (T = 1)
GROUP BY HP_4
) as x
on u.hp_4=x.hp_4
where u.hp_5 <> x.expr1
Random Solutions
Internet Security settings prevents me from opening a file
T-1 muxing converted into a signal that can be terminated at a cable modem
Hyper V with Dell Equallogic SAN out of space on VM because of snapshots
~~URGENT~~ enable Device usage
Using DCount for two fields?
A potentially dangerous Request.Form value was detected from the client ...
Awful font rendering in Adobe Acrobat Reader
Processor upgrade
Control timeline within loaded movieclip
2008 SBS