n****u 发帖数: 229 | 1 old_table has column "ICQ", type is varchar.
Well ICQ number is always int type.
So when I created new_table, I specified ICQ as int.
Then I insert old_table into new_table,
in new_table, the ICQ becomes 0 if it's empty in Old_table
Can I make ICQ empty in new_table? |
B*****g 发帖数: 34098 | 2 do you have default value?
【在 n****u 的大作中提到】 : old_table has column "ICQ", type is varchar. : Well ICQ number is always int type. : So when I created new_table, I specified ICQ as int. : Then I insert old_table into new_table, : in new_table, the ICQ becomes 0 if it's empty in Old_table : Can I make ICQ empty in new_table?
|
n********6 发帖数: 1511 | 3 int empty? 是不是null?
oracle default value都是null。
sql server varchar的default value我看到都是null。int的default value可能也是null。
你可能设置了default value为0。(未经过测试) |
j*****n 发帖数: 1781 | 4 try to use CASE statement when you do insert...select... |
c***c 发帖数: 6234 | 5 int只有null(你所说的empty)。
create 完 new table后,update 所有 0 to null。
【在 n****u 的大作中提到】 : old_table has column "ICQ", type is varchar. : Well ICQ number is always int type. : So when I created new_table, I specified ICQ as int. : Then I insert old_table into new_table, : in new_table, the ICQ becomes 0 if it's empty in Old_table : Can I make ICQ empty in new_table?
|
n****u 发帖数: 229 | 6 Thanks for all your reply.
I found out some ICQ records in old table look like xxx-xxx-xxx. So I might
stick with old type (varchar) |