一些不错的sql语句(面试可能碰到哦!)
例子1) 一个表Table_1 有两个字段
id number,
name varchar2(7)
其中id是主键,name有重复记录
要求删除name字段重复的记录,保留其中id字段值最小的那条记录
如:
id name
1 test
2 test
3 test
4 test1
5 test1
6 test1
删完 了保留
1 test
4 test1
&nbs
相关文档:
1.建一张表 存放数据 在下面SQL函数中有用到
create table solardata
(
yearid int not null,
data char(7) not null, ......
1.判断一个临时表是否存在
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U')
drop table #tempcitys
注意tempdb后面是两个. 不是一个的
---临时表
if exists(select * from tempdb..sysobjects where name like &lsqu ......
在Windows 2003 sp1服务器上缺省安装 MS SQL Server 2005 简体中文企业版,在连接服务器时显示“不允许远程连接”。
具体显示如下:(xxxxxsql为服务器名,在本地操作)
C:\Documents and Settings\Administrator>sqlcmd -S xxxxxsql
HResult 0x2,级别 16,状态 1
命名管道提供程序: 无法打开与 SQL Server ......
c06 --------------7545623条
c05---------------1032652条
vc01--------------427741条
SQL Statement from editor:
select c0602 "商品编码",c0625 "商品条码",
c0103 "商品名称",c0104 "规格",c060 ......
SQL*LOADER是ORACLE的数据加载工具,通常用来将操作系统文件迁移到ORACLE数据库中。SQL*LOADER是大型数据
仓库选择使用的加载方法。
在NT下,SQL*LOADER的命令为SQLLDR,在UNIX下一般为sqlldr/sqlload。
如执行:d:\oracle>sqlldr
SQL*Loader: Release 8.1.6.0.0 - Production on 星期二 1月 8 11:06:42 2 ......