我在本地資料庫 Mariadb 上的 XAMP 中作業,并想將一個單詞添加/連接到一個 int 這是我的查詢
Select 'id:' cast(Cid as varchar) from table where Cid is 3747;
結果應該是 id:3747
我在這里做錯了什么?
uj5u.com熱心網友回復:
使用 CONCAT。
并且該IS運算子僅用于 [NOT] NULL。
鐵select col from tbl where col IS NOT NULL
select concat('id:', Cid) as result
from table
where Cid = 3747
但是你可以使用IN還
select concat('id:', Cid) as result
from table
where Cid in (3747)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/399510.html
上一篇:如何使用ROOM格式化查詢
