简体   繁体   中英

Sqlite ON statement on calculated field failing

I'm trying the following query with no luck:

SELECT B.id AS BookId, P.id AS PdfId FROM tbl_Books AS B
INNER JOIN tbl_PDF AS P ON P.FileName = B.ShortName || '.pdf'
COLLATE NOCASE

Is in Sqlite possible to use a clause in ON statement?

Thanks

I think what you need is coalesce(b.ShortName, '.pdf') . Be aware, though, that it will return empty string if b.ShortName is an empty string (as opposed to null ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM