notorm icon indicating copy to clipboard operation
notorm copied to clipboard

How to avoid TO_CHAR(date, format) being interpreted as join?

Open brachetti opened this issue 9 years ago • 0 comments

I have a select like this $risks->select("TO_CHAR(table.last_updated_date,'DD.MM.YYYY HH24:MI:SS') as SNAP")->fetch();

NotOrm now compiles this to SELECT TO_CHAR(risks.LUD,'MM.YYYY MI.SS') as SNAP FROM risks LEFT JOIN DD ON risks.DD_id = DD.id LEFT JOIN MM ON DD.MM_id = MM.id LEFT JOIN HH24 ON risks.RISK_ID = HH24.RISKS_id LEFT JOIN MI ON HH24.id = MI.HH24_id WHERE (risks.RISK_ID = 12345)

How can I suppress this behaviour?

brachetti avatar Dec 22 '15 12:12 brachetti