Created
September 28, 2020 05:23
-
-
Save wmakeev/c4a9751dea436eb8c7062d6bb36a7991 to your computer and use it in GitHub Desktop.
[SQL tips] #sql #tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 100 | |
ActiveDocumentPosition.metaType, | |
SUM( | |
CASE | |
WHEN ActiveDocumentPosition.metaType = 'demandposition' | |
THEN ActiveDocumentPosition.price | |
ELSE -ActiveDocumentPosition.price | |
END | |
) AS value | |
FROM ActiveDocumentPosition | |
GROUP BY ActiveDocumentPosition.metaType; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment