Hi guys,
need some help here please...
The code below shows 4 rows.
The first two rows are almost identical, but the two of them exists in the same table as different rows.
Row number 1 is also related to Row number 3 and Row number 2 is also related to Row number 4
The problem is that I have to use only one of then (Rows number 1 or 2) togheter with row 3 & 4.
I thought using GROUP BY RECEIPTJURNALMATCH.JURNALTRANSID, but getting error.
Thanks in advance,
Aldo.
SELECT
RECEIPTJURNALMATCH
.JURNALTRANSID AS 'R.JURNALTRANSID',RECEIPTJURNALMATCH
.MATCHNUM AS 'R.MATCHNUM',JURNALTRANSMOVES
.ACCOUNTKEY AS 'J.ACCOUNTKEY',JURNALTRANSMOVES
.SUF AS 'J.TOTAL',STOCK
.REMARKS AS 'S.REMARKS'
FROM
RECEIPTJURNALMATCH
INNER
JOIN JURNALTRANSMOVES ON RECEIPTJURNALMATCH.JURNALTRANSID = JURNALTRANSMOVES.IDLEFT
OUTER JOIN STOCK ON RECEIPTJURNALMATCH.STOCKID = STOCK.ID
WHERE
JURNALTRANSMOVES
.ACCOUNTKEY IN ('123456')
Below the results:
R.JURNALTRANSID R.MATCHNUM J.ACCOUNTKEY J.TOTAL S.REMARKS
89634 16702 123456 1155 : ;5752
89634 16703 123456 1155 : ;5752
89637 16702 123456 400 NULL
89639 16703 123456 155 NULL