How does one avoid creating a null field when doing a concat with a field that is null in Firebird.
with data as ( select article_name || ' STK:' || cast(quantity as integer) || NOTES as quantity ,PREORDER_ID as PID from preorder_item )
SELECT PREORDER.NAME ,PREORDER.DELIVERY_DATE ,LIST(DATA.QUANTITY, ' | ')
FROM PREORDER
INNER JOIN DATA ON PREORDER.ID =
DATA.PID GROUP by PREORDER.NAME ,PREORDER.DELIVERY_DATE
In all the fields were my NOTES are NULL the whole content is null how can I work around this and only add the notes information when it is available.
I already tried something like
with comments as (select NOTES as NOTES,PREORDER_ID as PID FROM PREORDER_ITEM where NOTES is not NULL)
with data as ( select article_name || ' STK:' || cast(quantity as integer) as quantity ,PREORDER_ID as PID from preorder_item )
SELECT PREORDER.NAME ,PREORDER.DELIVERY_DATE ,LIST(DATA.QUANTITY, ' | ')
FROM PREORDER
INNER JOIN DATA ON PREORDER.ID = DATA.PID
INNER JOIN COMMENTS ON PREORDER.ID = COMMENTS.PID
GROUP by PREORDER.NAME ,PREORDER.DELIVERY_DATE