[英]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? 在Sqlite中可以在ON语句中使用子句吗?
Thanks 谢谢
I think what you need is coalesce(b.ShortName, '.pdf')
. 我认为您需要的是
coalesce(b.ShortName, '.pdf')
。 Be aware, though, that it will return empty string if b.ShortName
is an empty string (as opposed to null
). 但是请注意,如果
b.ShortName
是空字符串(而不是null
),它将返回空字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.