帮我看看~~谢谢insert into export(id,nf,yf,byds,sgds,bj)select e.remote_id as id,year('2012-11-13') as nf,month('2012-11-13') as yf,e.readdata as byds,'0','N' from readdata as e inner join(select distinct a.xiaoqu_name ,a.remote_id as remote_id,max(b.readtime) as readtime from user_data as a inner join readdata as b on a.remote_id=b.remote_id and a.selinfo='EV2双月16_20日' and b. readtime>'2012-11-07' and b.readtime < '2012-11-14' group by a.xiaoqu_name,a.remote_id ) as f on e.remote_id=f.remote_id and e.readtime=f.readtime order by substring(f.remote_id,1,6),substring(f.remote_id,7,2),substring(f.remote_id,9,2)
解决方案 »
- 再发一帖,关于API拦截,侠进。
- 如何利用delphi改变或者拦截网页的提交按钮属性
- 有关DOA的问题??
- 如何实现鼠标拖动form中的image??
- 大家谁知道delphi利用用什么控件可以模拟甘特图(类似project中相关功能)?
- 如何用DELPHI做个象遨游那样的界面?
- 小菜题一道,可别说不知道啊!!! ^_^
- 求图片切割算法,各位大神帮帮忙,搞了好多天了还没弄出来
- 如何得到这样的消息?
- 请教:怎样实现当一个richedit滚动时(包括键盘和拖动滚动条)另一个richedit同步滚动
- delphi函数在不同源代码文件中的函数声明
- delphi xe2 IdHTTP1出现乱码,怎么解决?
insert into export(id,nf,yf,byds,sgds,bj)select e.remote_id as id,year('2012-11-13') as nf,month('2012-11-13') as yf,e.readdata as byds,'0','N' from readdata as e inner join(select distinct a.xiaoqu_name ,a.remote_id as remote_id,max(b.readtime) as readtime from user_data as a inner join readdata as b on a.remote_id=b.remote_id and a.selinfo='EV2双月16_20日' and b. readtime>'2012-11-07' and b.readtime < '2012-11-14' group by a.xiaoqu_name,a.remote_id ) as f on e.remote_id=f.remote_id and e.readtime=f.readtime order by substring(f.remote_id,1,6),substring(f.remote_id,7,2),substring(f.remote_id,9,2)
select e.remote_id as id,year('''2012-11-13''') as nf,
month('''2012-11-13''') as yf,e.readdata as byds,'''0''','''N'''
from readdata as e
inner join(select distinct a.xiaoqu_name ,a.remote_id as remote_id,max(b.readtime) as readtime
from user_data as a inner join readdata as b on a.remote_id=b.remote_id
and a.selinfo='''EV2双月16_20日''' and b. readtime>'''2012-11-07'''
and b.readtime < '''2012-11-14''' group by a.xiaoqu_name,a.remote_id ) as f
on e.remote_id=f.remote_id and e.readtime=f.readtime
order by substring(f.remote_id,1,6),substring(f.remote_id,7,2),
substring(f.remote_id,9,2)
+ ' (ID, NF, YF, BYDS, SGDS, BJ)'
+ ' SELECT E.REMOTE_ID AS ID, YEAR (''2012-11-13'') AS NF,'
+ ' MONTH (''2012-11-13'') AS YF, E.READDATA AS BYDS, ''0'', ''N'''
+ ' FROM READDATA AS E'
+ ' INNER JOIN'
+ ' (SELECT DISTINCT A.XIAOQU_NAME, A.REMOTE_ID AS REMOTE_ID,'
+ ' MAX (B.READTIME) AS READTIME'
+ ' FROM USER_DATA AS A INNER JOIN READDATA AS B'
+ ' ON A.REMOTE_ID = B.REMOTE_ID'
+ ' AND A.SELINFO = ''EV2双月16_20日'''
+ ' AND B.READTIME > ''2012-11-07'''
+ ' AND B.READTIME < ''2012-11-14'''
+ ' GROUP BY A.XIAOQU_NAME, A.REMOTE_ID) AS F'
+ ' ON E.REMOTE_ID = F.REMOTE_ID AND E.READTIME = F.READTIME'
+ ' ORDER BY SUBSTRING (F.REMOTE_ID, 1, 6),'
+ ' SUBSTRING (F.REMOTE_ID, 7, 2),'
+ ' SUBSTRING (F.REMOTE_ID, 9, 2)';
ADOQuery1.SQL.Text:=
'insert into export(id,nf,yf,byds,sgds,bj)select e.remote_id as id,year('
+QuotedStr('2012-11-13')
+') as nf,month('
+QuotedStr('2012-11-13')
+') as yf,e.readdata as byds,'
+QuotedStr('0')
+','
+QuotedStr('N')
+' from readdata as e inner join(select distinct a.xiaoqu_name ,'
+'a.remote_id as remote_id,max(b.readtime) as readtime from user_data as a'
+' inner join readdata as b on a.remote_id=b.remote_id and a.selinfo='
+QuotedStr('EV2双月16_20日')
+' and b. readtime>'
+QuotedStr('2012-11-07')
+' and b.readtime < '
+QuotedStr('2012-11-14')
+' group by a.xiaoqu_name,a.remote_id ) as f on e.remote_id=f.remote_id and '
+'e.readtime=f.readtime order by substring(f.remote_id,1,6),'
+'substring(f.remote_id,7,2),substring(f.remote_id,9,2)';
ADOQuery1.ExecSQL;