Forum Replies Created
-
AuthorPosts
-
Diana MagersMember'peterlaursen' wrote:
How is this related to 'Query Builder and Schema Designer' category in this Forum?
Please paste the complete (SELECT) statement? You did not miss a COMMA after 'customer_name'?
Also what client returns exactly this error:
“Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'Balance'.”
.. it is not a standard MySQL server or client error.
Please forgive me I clearly mis-post. I actually got the answer worked out. Thank you again. Diana Magers
Diana MagersMember'peterlaursen' wrote:Well .. then te query returns an empty set (no rows satisfies the condition).
Take an analytical approach .. simplify. Do these queries return what you'd expect?
1)
SELECT COUNT(ON_HAND)
FROM INVENTORY
WHERE INVENTORY.ON_HAND > '25';
2)
SELECT BRANCH.BRANCH_NUM, INVENTORY.ON_HAND
FROM INVENTORY, BRANCH
WHERE BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM';
If somebody should be able to help you you will need to post an exact case with table definitions and sample data.
Actually it came out to be:
SELECT BRANCH.BRANCH_NUM, SUM(INVENTORY.ON_HAND) as UnitsOnHand
FROM BRANCH JOIN INVENTORY
ON BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM
GROUP BY BRANCH.BRANCH_NUM
HAVING SUM(INVENTORY.ON_HAND)>25
Diana MagersMember'peterlaursen' wrote:Well .. then te query returns an empty set (no rows satisfies the condition).
Take an analytical approach .. simplify. Do these queries return what you'd expect?
1)
SELECT COUNT(ON_HAND)
FROM INVENTORY
WHERE INVENTORY.ON_HAND > '25';
2)
SELECT BRANCH.BRANCH_NUM, INVENTORY.ON_HAND
FROM INVENTORY, BRANCH
WHERE BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM';
If somebody should be able to help you you will need to post an exact case with table definitions and sample data.
Actually it came out to be:
SELECT BRANCH.BRANCH_NUM, SUM(INVENTORY.ON_HAND) as UnitsOnHand
FROM BRANCH JOIN INVENTORY
ON BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM
GROUP BY BRANCH.BRANCH_NUM
HAVING SUM(INVENTORY.ON_HAND)>25
-
AuthorPosts