求助一下
set @openid1 =(select openid from table1 where tel='13812345678');
select @openid1;
IF (@openid1 is null) OR (@openid1='') THEN
set @openid1 =(select openid from table2 where tel='13812345678');
END IF
select @openid1;
上面的代碼會提示錯誤在
IF (@openid1 is null) OR (@openid1='') THEN
set @openid1 =(select openid from table2 where tel='13812345678');
END IF
select @openid1;
這一段中,改了好久沒改對
uj5u.com熱心網友回復:
通過用戶的手機號碼,獲取他的openid,先從table1讀取,如果table1沒有,則讀取table2, 邏輯上很簡單,但是語法上,不知道為什么一直報錯uj5u.com熱心網友回復:
SET @openid1 =(select openid from table1 where tel='13812345678');
SELECT @openid1;
IF (@openid1 is null) OR (@openid1='') THEN
set @openid1 =(select openid from table2 where tel='13812345678');
END IF;
select @openid1;
uj5u.com熱心網友回復:
END IF;END IF 這里要以分號結尾
uj5u.com熱心網友回復:
手機回帖,猜測應該這樣。if (o1 is null or o1=‘’) then...轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/75186.html
標籤:MySQL
