由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - How to replace 0 with empty?
相关主题
问一个SQL Server的问题sql server 行转列的问题
Help on Sql server huge table performanceSQL help.
请教三个Key的property,How to get other columns after UNION?
Urgent help needed, pleaseQ on adding new column
Join optimization请教Load table的问题
About INSERT IGNORESQL Server Trigger on System Base Table or Catalog View
SQL问题请教: add one more columnSQL add some columns into a table from another table (转载
SQL find distinct values in large table请教一个mysql 排序问题。
相关话题的讨论汇总
话题: icq话题: empty话题: table话题: replace话题: old
进入Database版参与讨论
1 (共1页)
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)
1 (共1页)
进入Database版参与讨论
相关主题
请教一个mysql 排序问题。Join optimization
How to handle inserting value to Identity column in sql server 2005About INSERT IGNORE
SQL combine two columns from two different tables no shared (转载)SQL问题请教: add one more column
better way to compare nullable columns?SQL find distinct values in large table
问一个SQL Server的问题sql server 行转列的问题
Help on Sql server huge table performanceSQL help.
请教三个Key的property,How to get other columns after UNION?
Urgent help needed, pleaseQ on adding new column
相关话题的讨论汇总
话题: icq话题: empty话题: table话题: replace话题: old