您的位置:首页 > 数据库

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

2017-03-29 16:41 441 查看
表中插入一列:

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  sql