I apologize if this is really basic, but:
I feel that at some point I did not have this problem, and now I am, so either I did something completely different or my syntax skipped a step.
For example, I have a query that I need to return all rows with certain data along with another column that contains only one of these columns. If everything was as I expected, it would look like this:
SELECT
order_id,
cost,
part_id,
SUM(cost) AS total
FROM orders
WHERE order_date BETWEEN xxx AND yyy
And I would get all the lines with my orders, with the total amount superimposed on the end of each of them. I know that the total will be the same every time, but this was expected. Right now, to make this work, I use:
SELECT
order_id,
cost,
part_id,
(SELECT SUM(cost)
FROM orders
WHERE order_date BETWEEN xxx AND yyy) AS total
FROM orders
WHERE order_date BETWEEN xxx AND yyy
, , , . , , SUM , , , 3 , , , .
.