SQL中只有两列数据(字段1,字段2),将其相同字段1的行转列 转换前: 转换后: --测试数据 if not object_id(N'Tempdb..#T') is null drop table #T Go Create table #T([MDF_LOT_NO] int,[ERP_MODE_CD] int) Insert #T , union all , union all , union all , Go --测试数据结束 DECLARE @name VARCHAR(max),@sql
Sub Md() ' ' Macro1 Macro ' 宏由 BX 录制,时间: 2012-6-8 ' 宏中的列数可以输入 A - IV 也可以输入 1-256 ' Dim i%, j%, i1%, j1%, i2%, j2% myi = UCase(InputBox("第一列")) myj = UCase(InputBox("第二列")) ' '************************************ If myi Like "[A-Z]
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u011925175/article/details/24186917 有一个mysql数据库的表,要查询他的最后两条数据的结果例如以下: 这是原表中的内容: idname 1 ad 2 jk 3 tre 4 hgv 这是查询的最后两条的数据的内容(为最新的插入的数据): 语句:select * from demo1 order by id desc limit 0,2; 结果:id n
dmp文件的导入:1.首先,先创建表空间与用户--创建表空间create tablespace CCFOCUS01datafile 'D:\app\Administrator\oradata\orcl\CCFOCUS01.dbf'size 100Mautoextend on next 32Mmaxsize unlimited; --创建用户create user userfocus identified by pasfocusdefault tablespace CCFOCUS01;grant
先在hive里面创建一个表 create table mydb2.t3(id int,name string,age int) row format delimited fields terminated by ','stored as textfile; 接下来创建数据文件 把本地的数据文件导入到hive表中 LOAD DATA LOCAL INPATH '/opt/datas/a.txt' OVERWRITE INTO TABLE t3; 接下来把hdfs上的文件导入到hive表中 现在在
1.如果是整个表复制表达如下: insert into table1 select * from table2 2.如果是有选择性的复制数据表达如下: insert into table1(column1,column2,column3...) select column1,column2,colunm3... from table2 3.一个数据库中的表中的数据复制到另一个数据库中的一个表,使用方法如下: insert into 数据库A.dbo.table1(col1,col2,col3..