insert into phone2(ph,attr,type,carrier) select top 1000 ph,attr,type,carrier from phone 将表phone的字段和前1000条数据复制到Phone2表 数据库中的某个表删除重复数据(phone2表不能存在) select distinct * into phone2 from phone 表phone的数据放到phone2中(phone2表可以存在) insert into phone2(ph,attr,ty…
有时,我们需要对比两张表的数据,找到在其中一张表,不在另一张表中的数据 hql 如下: SELECT * FROM (SELECT id FROM a WHERE dt = '2019-03-17' ) a LEFT JOIN (SELECT id FROM b ) b ON a.id = b.id WHERE b.id IS NULL;…
公司业务需要,在对表进行操作的时候将操作人和操作记录记录到日志表里.记录下来以供参考和学习. 首先准备两张测试表:Info以及InfoLog 1.表结构相同的情况下: insert into InfoLog select * from Info 2.表结构不同的情况下,我们只需要指定列就可以: insert into InfoLog(ID,[Name]) select ID,[Name] from Info 执行结果如下: --指定的数…
function putStartCard(handCard) function dataDeal(array,a,b,c) cclog("进入datadeal====================================") ,#array do cclog("array[%d]======%d",i,array[i]) end local result = {} then ,#array do if a == array[i] then , #arra…