May be this is what you want:
SELECT
ReceiptID,
(SELECT FIRST 1 S.Service
FROM ReceiptLine RLF JOIN Service S ON (S.ServiceID = RLF.ServiceID)
WHERE RLF.ReceiptLineID = MIN(RL.ReceiptLineID)
) AS Service,
SUM(Qty*Cost) Price
FROM
ReceiptLine RL
GROUP BY
ReceiptID
Steve
Try :
Grou by 1,2
instead of GROUP BY ReceiptID, Service
Marcin
-- Wiadomość oryginalna --
Od: "stevef...@yahoo.com [firebird-support]"
Do: firebird-support@yahoogroups.com
Wysłano: 18.01.2016 09:50:08
Temat: [firebird-support] 'Invalid
Of cousre it should be
Group by 1, 2
Fingers too quick - sorry
Marcin
-- Wiadomość oryginalna --
Od: "'Marcin Bury' marcin.b...@studio-delfi.pl [firebird-support]"
Do: firebird-support@yahoogroups.com; firebird-support@yahoogroups.com
Wysłano:
This error: "Dynamic SQL Error SQL error code = -104 Invalid expression in the
select list (not contained in either an aggregate function or the GROUP BY
clause)" is returned by the following SQL:
SELECT
ReceiptID,
(
SELECT FIRST 1 S.Service FROM Service
It does not work. Same error.
Yes, it worked. Thank you!
So I've got this stored procedure which takes DECIMAL(18,6) parameters
and returns DECIMAL(18,12) results, and internally copies stuff into and
out of DOUBLE PRECISION variables which it uses to call a UDF to do the
actual calculations.
And the results are different (in the 8th decimal place
On 18/01/2016 17:34, 'Leyne, Sean' s...@broadviewsoftware.com
[firebird-support] wrote:
Tim,
> So I've got this stored procedure which takes DECIMAL(18,6)
parameters and
> returns DECIMAL(18,12) results, and internally copies stuff into and
out of
> DOUBLE PRECISION variables which it uses
Tim,
> So I've got this stored procedure which takes DECIMAL(18,6) parameters and
> returns DECIMAL(18,12) results, and internally copies stuff into and out of
> DOUBLE PRECISION variables which it uses to call a UDF to do the actual
> calculations.
>
> And the results are different (in the 8th