在存储过程中写了下面这个脚本,但是运行以后,在表中查看结果没有任何效果?为什么? 在创建的表中只有列~~ CREATE PROCEDURE tester AS BEGIN SET NOCOUNT ON; DECLARE @count int; SET @count=0 WHILE @count<20 BEGIN INSERT INTO [test].[dbo].[info] VALUES('histor','histor') SET @count=@count+1 PRINT @count END END
by pb861028 - MySQL - 2008-07-16 23:07:45 阅读(2432) 回复(2)
表一如下: XH RQ JE 1 2009-11-1 100 2 2009-11-2 3 2009-11-3 4 2009-11-4 5 2009-11-5 200 6 2009-11-6 7 2009-11-7 500 8 2009-11-8 9 2009-11-9 10 2009-11-10 800 部分记录JE为空,请教如何使用DB2循环语句update得到如下结...
表T_EMP_INFO,有离职日期字段S1。 我做的是从某一年到某一年离职人数的统计。 例如:从2002年到2006年 想得到如下的结果: 年 离职人数 2002 10 2003 13 2004 9 2005 15 2006 12 开始年和结束年是未知的,可以设两个变量S_YEAR和E_YEAR.
我有两个表,现在需要把表1查询出select prop_val from data_prop_inst where prop_name=\'文件题名\'的值更新到表2的PROC_NAME中,一条记录以实现了,代码如下: update error_fwspb_hzy set PROC_NAME =(select prop_val from data_prop_inst where prop_name=\'文件题名\') from error_fwspb_hzy,data_prop_inst where PROC_NAME =\'发文审批表\' and error_fwspb_hzy.proc_id = data_prop_inst.proc_id 但现在表中有多条记录,要根...
有一自循环表,表名Dept 字段如下: Id 部门编号 PId 上级部门编号 给一部门编号,比如说Id=1,求其下属所有的叶子节点,如何用sql实现? 如果要获取以Id=1为根的树形结构,又如何用sql实现?
各位大虾请帮我看一下错在哪里???
源码:
while read get_cellphone_number
do
while read get_date
do
sqlplus cbqr/zm01cbqr@zjcb1 <
for i=0,i++,i<@num select dateadd(DAY,GETDATE(),I) 请问上面的语句怎么改写才正确??? 感谢!!! [email]etqxq@hotmail.com[/email]
ALTER trigger po_podetails_bt on po_Podetails for insert as declare @cinvcode varchar(20) select @cinvcode=cinvcode from inserted select cinvcode,id from po_podetails where cinvcode=@cinvcode group by cinvcode,id order by cinvcode, id desc update po_podetails set cdefine26=itaxprice from (select top 2 cinvcode,id from po_podetails group by cinvcode,id order by cinvcode, id desc )t where po...
在opt/oracle/backdb/redolog/下有些归档日志,格式=***1725822234.dat但是没有注册到dataguard的备机,我现在要读取这个目录下得所有归档并执行 alter database register physical logfile '/opt/oracle/backdb/redolog/***1725822234.dat"'; 我写的脚本 source /etc/profile source /home/oracle/.bash_profile cd /home/oracle/ ll /opt/oracle/backdb/redolog |grep .dat |awk '{print $9 }' >/home/oracle/registerlogfile.tx...
大家好,我基本达到这样一个目的,但我不知道循环语句怎么写,目前比较苯,每天手动来执行。 1。查询第一个数据库的表TABLE1,得到“点击数”排名前10的ip地址 SELECT * FROM (SELECT '点击数', userip, count(*) as useript_count FROM TABLE1 Q WHERE Q.BEGINTIME >= TRUNC(SYSDATE) - 1 AND Q.BEGINTIME < TRUNC(SYSDATE) group by userip ORDER BY count(q.userip) desc) W...