我在sql server中的声明是 [英] my statement in sql server is
问题描述
我在sql server中的声明是
CASE当NumberofArticle IS NULL或NumberofArticle =''THEN''ELSE A.NumberofArticle END AS NumberofArticle,
i得到了正确的结果,但是我想要(20条)然后文章这个词怎么会来到那里...
my statement in sql server is
CASE WHEN NumberofArticle IS NULL OR NumberofArticle='' THEN '' ELSE A.NumberofArticle END AS NumberofArticle,
i am getting right result but 20 but i want (20 Article) then how the word Article will come over there ...
推荐答案
试试这个:
Try this:
CASE WHEN NumberofArticle IS NULL OR NumberofArticle='' THEN '' ELSE CONCAT(CONVERT(VARCHAR(5), A.NumberofArticle), ' article(s)') END AS NumberofArticle,
有关更多信息,请参阅:
< a href =http://technet.microsoft.com/en-us/library/aa276862%28v=sql.80%29.aspx> +(srting concatenation) [ ^ ]
CONCAT [ ^ ]
CAST和CONVERT(T-SQL) [ ^ ]
For furter information, please see:
+ (srting concatenation)[^]
CONCAT[^]
CAST and CONVERT (T-SQL)[^]
尝试这样的事情
how-do-i-append-string-end-sql-query-results [ ^ ]
Try something like this
how-do-i-append-string-end-sql-query-results[^]
你的问题不明确。我想你期待这一个
you question is not clear. i guess you expecting this one
CASE WHEN NumberofArticle IS NULL OR NumberofArticle='' THEN '' ELSE A.NumberofArticle +' Aricles' END AS NumberofArticle,
这篇关于我在sql server中的声明是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!