SQL Convention
From iDempiere en
SQL use on idempiere need to follow some strict rule to pass internal parse sql parse discuss on mattermost
sql can come from somewhere as virtual column,...
1. ON clause need to input condition on "()"
FROM tabel1 tb1 JOIN table2 tb2 ON tb1.column1 = tb2.column1 then "tb1.column1 = tb2.column1" need to inside "()"
reference bellow code on AccessSqlParser.getTableInfo
indexClose = from.lastIndexOf(')', indexNextOn);
2. Keyword should use uppercase
3. no space between "(" and keyword
Select column1, ( Select column2 FROM subTb stb) AS cl2 FROM mainTb
reference bellow code on AccessSqlParser.getSubSQL
index = sql.indexOf("(SELECT ", 7);