易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL中declare申明变量

在sql语句中添加变量。
declare @local_variable data_type
声明时需要指定变量的类型,
可以使用set和select对变量进行赋值,
在sql语句中就可以使用@local_variable来调用变量
声明中可以提供值,否则声明之后所有变量将初始化为NULL。
例如:declare @id int
         declare @id int = 3
         set @id=2
         select id
         select @id = column_id from table where column_user = 'ABC'


相关文档:

sql语句 递归

select s.*  from t_info t,t_info_class_relationship s where t.id=s.info_id and t.status is not null and s.class_id in(
select a.id
    from T_INFO_CLASS a
    start with a.parent_id=39902
    connect by prior
    a.id =parent_id u ......

oracle dba 常用sql語句

常用SQL查询:
 
1、查看表空间的名称及大小
 
select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;
 
2、查看表空间物理文件的名称及大小
 
select t ......

sql数据库的关键字及查询及函数

    本周和上周经理给我们做了两次关于sql的培训,感觉很有用所以总结一下!
    Union:只有两张表结构相同的结果集才能使用union,将所有的表数据放到一个结果集中。
    Count:计算参数列表中的数字项的个数。括号里边可以是列名,也可以是参数值。
    ......

SQL Server 2005启用sa账号


SQL Server 2005启用sa账号
启用sa用户和远程连接 
菜单Start->Microsoft SQL Server 2005->Configuration Tools->SQL Server Configuration Manager 
选中SQL Server 2005 Network Configuration 
在右边的TCP/IP上点右键,enabled 
菜单Start->Microsoft SQL Server 2005->SQL ......

SQL触发器实例

定义: 何为触发器?在SQL Server里面也就是对某一个表的一定的操作,触发某种条件,从而执行的一段程序。触发器是一个特殊的存储过程。
      常见的触发器有三种:分别应用于Insert , Update , Delete 事件。
      我为什么要使用触发器?比如,这么两个表:
& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号