记录几个sql语句
2010-09-28 15:08
274 查看
1、插入带时间与null值的
insert into product values(null,'','20422REV','','','','','','','','','','','','',getdate(),getdate(),'','hl-qc','','')
2、插入不重复的数据的
insert into product select other1,other2,other3,other4,other5,other6,other7 from product_temp where not exists(select * from product where other1=product_temp.other1 or other2=product_temp.other2)
insert into product select item,ref,other_item,rose_item,rose_len,leaf_item,leaf_len,base_item,base_len,others1,others2,others3,others4,item_check,qc_check,pic_date,add_date,adder,pic,pichave,item_sort from product2 where not exists(select * from product where item=product2.item or other_item=product2.other_item)
3、查询重复的数据的
select * from product_temp where not exists(select * from product where other1=product_temp.other1 or other2=product_temp.other2)
4、复制表结构的
select * into product1 from product where 1=2
insert into product values(null,'','20422REV','','','','','','','','','','','','',getdate(),getdate(),'','hl-qc','','')
2、插入不重复的数据的
insert into product select other1,other2,other3,other4,other5,other6,other7 from product_temp where not exists(select * from product where other1=product_temp.other1 or other2=product_temp.other2)
insert into product select item,ref,other_item,rose_item,rose_len,leaf_item,leaf_len,base_item,base_len,others1,others2,others3,others4,item_check,qc_check,pic_date,add_date,adder,pic,pichave,item_sort from product2 where not exists(select * from product where item=product2.item or other_item=product2.other_item)
3、查询重复的数据的
select * from product_temp where not exists(select * from product where other1=product_temp.other1 or other2=product_temp.other2)
4、复制表结构的
select * into product1 from product where 1=2
相关文章推荐
- 几个删除重复记录的SQL语句!
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句(转)
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- SQL语句 对表按某几个字段分组,并生成组内记录数范围内的随机序号.
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 几个删除重复记录的SQL语句
- 在X3里读取不到sql语句查询中有中文的记录
- 用sql语句查看oracle表每条记录的创建时间(ora_rowscn)
- SQL语句快速添加表的记录
- 读取随机记录的例子 SQL语句
- 随机抽取记录的sql语句