on 03-14-2024 3:23 PM
We have a Z-table name zabrufmat. We are using sqlcli on a Linux host.
select a.MATNR,
a.mo AS Bedarf,
SUM(b.VERME) AS HRL_Bestand,
(SUM(b.VERME) - a.mo AS Delta
FROM ZABRUFMAT a
LEFT OUTER JOIN LQUA b ON (a.MATNR = b.MATNR AND b.LGTYP = 'HRL')
GROUP BY a.MATNR,a.mo,lgtyp
If for a given material from table zabrufmat is nothing in stock, the result is NULL (nothing). From other RDBMS i know the SQL function coalesce(). Is there anything similar available for sqlcli/MaxDB?
For historical reasons, MaxDB supports different SQL modes. In our internal SQL mode, the counterpart to the COALESCE() function is called VALUE(). COALESCE() works directly in Oracle or SAPR3 SQL mode:
sqlcli -d sdb -u dba,dba select value(3, null, 2, null,1) from dual
| EXPRESSION1 |
| -------------------- |
| 3 |
1 row selected (453 usec)
sqlcli -d sdb -u dba,dba -S oracle select coalesce(3, null, 2, null,1) from dual
| EXPRESSION1 |
| -------------------- |
| 3 |
1 row selected (481 usec)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.