sqlite3中的if else问题

zhongkuizhang 2012-12-22 10:27:54
if exists(select * from BD_ProductStore where specid=1 and gradeid=1 and productlength=12.0) then
select '1'
else
select '2'
end
...全文
814 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhongkuizhang 2012-12-22
  • 打赏
  • 举报
回复
在线急等,熟悉的朋友帮忙给看看
iihero_ 2012-12-22
  • 打赏
  • 举报
回复
不要这样用,sqlite似乎不支持这样的语法。 你直接用select 1 from BD_ProductStore where specid=1 and gradeid=1 and productlength=12.0 看有无结果,在程序里判断
zhongkuizhang 2012-12-22
  • 打赏
  • 举报
回复
查询出不来 我想着通过判断是否存在一行记录,来更新,或者新增一行
iihero_ 2012-12-22
  • 打赏
  • 举报
回复
出什么问题了?

2,209

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 其他数据库
社区管理员
  • 其他数据库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧