avatar
Olay rebate UPC code# Fashion - 美丽时尚
l*9
1
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL copy a table into a new table and add a new column
发信站: BBS 未名空间站 (Fri May 23 12:05:22 2014, 美东)
need to copy a table into a new table on SQL server 2008. Also, add a new
column into the new table.
The values of the new column depends on the compare result between the new
table and another table.
Example,
Table1:
col1 col2 col3
abc 346 6546
hth 549 974
Table1_new:
col1 col2 col3 col4
abc 346 6546 1
hth 549 974 0
Table2:
col1
abc
sfsdf
If Table2's col1 appear in Table1 col1, mark col4 as 1 in Table1_new, else
mark as 0.
The code does not work
SELECT *,
(
SELECT 1 as col4
FROM Table2 as a
INNER JOIN Table1 as b
on b.col1 = a.col1
SELECT 0 as col4
FROM Table2 as a
INNER JOIN Table1 as b
on b.col1 <> a.col1 # I do not know how to do this !!!
)
INTO table1_new
FROM table1
Any help would be appreciated.
avatar
b*e
2
比如在一个句子描述时,
my papers have been cited independently for ***times,
OR my papers have been cited for ***times excluding my own citation?
那个更地道点? 谢谢
avatar
a*t
3
主要是美国股市和options。多谢了
avatar
d*i
4
为嘛我的三瓶大红霜上的UPC 全是一样的呢?一模一样啊
avatar
d*n
5
first

【在 b***e 的大作中提到】
: 比如在一个句子描述时,
: my papers have been cited independently for ***times,
: OR my papers have been cited for ***times excluding my own citation?
: 那个更地道点? 谢谢

avatar
i*r
6
Fidelity
avatar
b*e
7
谢谢!

【在 d*******n 的大作中提到】
: first
avatar
T*s
8
新手慎玩option
Fidelity不错
比思考特稳定多了
avatar
a*t
9
多谢各位的帮助和提醒。
avatar
h*8
10
本金1万以上就开IB吧?

【在 a*********t 的大作中提到】
: 主要是美国股市和options。多谢了
avatar
s*e
11
IB很好
avatar
n*m
12
IB(interactive broker) 很好
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。