na as priejau tokio sprendimo
SELECT Part_kodas, Part_Pavad, SUM(Preklik_su_pvm) AS Viso
,S20404 = SUM( CASE WHEN sandelis= '20404' THEN Preklik_su_pvm ELSE 0 END )
,S20405 = SUM( CASE WHEN sandelis= '20405' THEN Preklik_su_pvm ELSE 0 END )
,S20406 = SUM( CASE WHEN sandelis= '20406' THEN Preklik_su_pvm ELSE 0 END )
,S20411 = SUM(CASE WHEN sandelis= '20411' THEN Preklik_su_pvm ELSE 0 END )
,S20413 = SUM( CASE WHEN sandelis= '20413' THEN Preklik_su_pvm ELSE 0 END )
,S20414 = SUM( CASE WHEN sandelis= '20414' THEN Preklik_su_pvm ELSE 0 END )
FROM preklik_sumine
GROUP BY Part_kodas, Part_Pavad
bet gal yra koks paprastesnis ???
"paliava" <paliava@interneka_tratata.lt> wrote in message news:euq9kp$pl0$1@trimpas.omnitel.net...
pasiimi knyga eskūelas čeinykams atsiverti ties "group by" ir padarai.
"Vytautas" top@secret.com wrote in message news:euq93u$ol4$1@trimpas.omnitel.net...
ar galima padaryt toki selecta:
turim lentele:
Partneris Likutis Sandelis
is jos reikai gaut toke forma...
Partneris Likutis_sandlija_nr1 Likutis_sandelija_nr2 Likutis_sandelija_nr3 ir t.t. .....
ar taip imanoma padaryt Sql'e ???