开发者

IF ELSE statement SQLite

开发者 https://www.devze.com 2023-03-14 16:57 出处:网络
Could anyone help me write up an If Else statement for iPhone\'s SQLite? I need a: IF (SELECT COUNT (*) FROM ..... WHERE ... = \'..\') > 0

Could anyone help me write up an If Else statement for iPhone's SQLite?

I need a:

IF (SELECT COUNT (*) FROM ..... WHERE ... = '..') > 0 
BEGIN 
SELECT * FROM .... WHERE ... = '...' 
END

But I cannot get it to work. Is it even possible开发者_如何学Python with SQLite.

Thanks for any help!


SELECT 
  * 
FROM 
  .... 
WHERE 
  ... = '...' 
  AND (SELECT COUNT (*) FROM ..... WHERE ... = '..') > 0 
0

精彩评论

暂无评论...
验证码 换一张
取 消