Ako koristis SQL 2005 ili 2008 postoji trik sa FOR XMLom

, ako u SELECTu stavis neku operaciju umesto cistog polja FOR XML ce tretirati izlaz tog polja ka literal umesto kao node XML-a efektivno spajajuci stringove, ako se jos to uokviri u prazan Tag, dobija se SUM(string), onda se to lepo ubaci kao nested select i voila:
Code:
SELECT DISTINCT a.prva,
(SELECT '' + b.druga FROM Tabela AS b WHERE a.prva = b.prva FOR XML PATH('')) AS SumaStringova
FROM Tabela AS a
Ako je SQL 2000, postoji fora sa UDF funkcijom koja radi agregaciju po jednom kljucu, pa se onda selektuje kljuc i UDF, imam to negde na mom SQL-u od videcu da ti iskopam.
▪ "Why isn't my wireless mouse connected to the computer?" - 2008 Dumbest Technical Support Question award
▪ The word 'politics' is derived from the word 'poly', meaning 'many', and the word 'ticks', meaning 'blood sucking parasites' - Larry Hardiman
▪ If the good guy gets the girl, it's rated PG; if the bad guy gets the girl, it's rated R; and if everybody gets the girl, it's rated X