I dette særtema om aspekter af AI ser vi på skiftet fra sprogmodeller til AI-agenter, og hvordan virksomheder kan navigere i spændet mellem teknologisk hastighed og behovet for menneskelig kontrol.
Is value1 actually the data in the field Kolonne2? If it is then try SELECT *, (SELECT sum(kolonne1) from table1 WHERE [Kolonne2] = 'value1') AS SumOfvalue1 FROM table1
Is it possible to only have one line with totals, and then for all three values?
SumOfvalue1 SumOfvalue2 SumOfvalue3 1500 600 800
Synes godt om
Slettet bruger
03. januar 2007 - 11:51#9
SELECT (SELECT sum(kolonne1) from table1 WHERE [Kolonne2] = 'value1') AS SumOfvalue1, (SELECT sum(kolonne1) from table1 WHERE [Kolonne2] = 'value2') AS SumOfvalue2, (SELECT sum(kolonne1) from table1 WHERE [Kolonne2] = 'value3') AS SumOfvalue3 FROM table1
I have tried to change the query to show totals/sum, but that gives me a wrong result.
It's not a big problem though - I can just select the first record when I make the call to the database
Synes godt om
Slettet bruger
03. januar 2007 - 14:05#11
SELECT DISTINCT (SELECT sum(kolonne1) from table1 WHERE [Kolonne2] = 'value1') AS SumOfvalue1, (SELECT sum(kolonne1) from table1 WHERE [Kolonne2] = 'value2') AS SumOfvalue2, (SELECT sum(kolonne1) from table1 WHERE [Kolonne2] = 'value3') AS SumOfvalue3 FROM table1
Hvis der er point i sigte, så er terry vist i førertrøjen!~)
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.