sql语句使用-插入列与连接查询

来源:互联网 发布:考研形势数据图表分析 编辑:程序博客网 时间:2024/05/22 17:06

表中插入一列:
alter table 表名 add 列名 数据类型
如:alter table student add nickname char(20)

alter table [bitcoin].[dbo].[CoinbaseTransaction] add [OutputValueBtc] numeric(20,8)

执行插入语句后,不会像使用直接增加列一样,出现列无效的问题。


连接:
mysql> SELECT a.runoob_id, a.runoob_author, b.runoob_count FROM runoob_tbl a INNER JOIN tcount_tbl b ON a.runoob_author = b.runoob_author;

insert CoinbaseTransaction
SELECT [bitcoin].[dbo].[TransactionOutput].[OutputValueBtc]
,[bitcoin].[dbo].[TransactionOutput].[OutputScript]
,[bitcoin].[dbo].[TransactionOutput].[OutputIndex]
FROM [bitcoin].[dbo].[TransactionOutput]
INNER JOIN [CoinbaseTransaction] on [bitcoin].[dbo].[TransactionOutput].[BitcoinTransactionId] = [bitcoin].[dbo].[CoinbaseTransaction].[BitcoinTransactionId]


【1】参考链接:
http://www.runoob.com/mysql/mysql-join.html

0 0
原创粉丝点击