Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
CASE - how to use it with SUM function |
Thu, Dec 6 2007 8:09 AM | Permanent Link |
Joze | Hi,
I am trying this SQL: SELECT M.ID_laboratorija, M.ID_narocila, N.Storno, CASE UPPER(N.Storno) WHEN 'J' THEN 0 WHEN 'N' THEN SUM(M.Meritev_skupaj) END AS Sestevek INTO Memory\Temp FROM Opravljene_meritve M INNER JOIN Narocila N ON M.ID_narocila=N.ID_narocila LEFT OUTER JOIN Opravljene_meritve_delavci D ON D.ID_opravljene_meritve = M.ID_opravljene_meritve WHERE M.ID_narocila=9 GROUP BY ID_laboratorija but I get an error 11949 Invalid use of nonagregated colum in expresion in SELECT SQL statement at line 0, column 0 I want to use SUM only if N.Storno value='N', otherwise I want value 0 (zero). Can someone help me with this, please? Dbisam 4.22, D7 TIA, Joze |
Thu, Dec 6 2007 8:17 AM | Permanent Link |
Joze | Hi,
I just find an answer to my question in one of todays answers to someone else... Thanks Best regards, Joze |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |