作者people1234 (people)
看板Database
標題[SQL ] 資料累加問題
時間Tue Aug 22 19:09:52 2006
我想update一個欄位 a='01' 把它變成 a='0102'
update test set a=a+'02' where id=1;
可是這樣會變成a=3
update test set a=a*100+'02' where id=1;
會變成 a=102
...請問有啥麼方法可以辦到呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.244.125.224
1F:推 ppanerai:a 是什麼type ? 08/22 20:21
2F:推 chgc:那一種資料庫?? Oracle的連接符號是 || 08/22 23:43
3F:推 people1234:CHAR , MYSQL 08/23 08:48
4F:推 ankasc:use concat() 08/23 23:56