作者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