sql select时增加常量列

阅读更多
string sql="select a,b,'常量' as c from table"


注:单引号' ' 很重要,否则编译时会把其看成查询参数,从而提示参数未指定错误。

摘自:http://blog.sina.com.cn/s/blog_4d96ee050100webl.html
<a id="comments" name="comments"></a>
posted @ 2019-07-09 14:56  星朝  阅读(7251)  评论(0编辑  收藏  举报