Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

fastreport´òÓ¡´úÂë¼°SQLºÏ²¢×ֶεÄÓï¾ä

 procedure Tform1.Button5Click(Sender: TObject);
var
  p:pointer;
  FrfStr:string;
begin
  inherited;
  Screen.Cursor:=MYCURSORWAITHAND;
  with cdsPrint do
  begin
    Active:=false;
    //Õâ¸öSQLÓÃÓÚ½«remarkÖеļǼºÏ²¢µ½Ò»Æð!
    CommandText:='select a.ITEM_ID, a.ITEM_NAME,count(a.Coll_ID) as num,ltrim(max(sys_connect_by_path(a.remark, '';'')), '';'') remark '
      +' from (select /*+index(b,TAB_ORDER_I)*/ b.ITEM_ID,b.Coll_ID,b.ITEM_NAME,b.remark,row_number() over(partition by b.ITEM_ID order by b.ITEM_ID)'
      +' ITEM_ID1,row_number() over(order by b.ITEM_ID) + dense_rank() over(order by b.ITEM_ID) ITEM_ID2 '
      +' from TAB_ORDER b  where  b.Coll_ID ='''+DBComboBoxEh1.Text+''''
      +'  ) a'
      +' start with ITEM_ID1 = 1 connect by prior ITEM_ID2 = ITEM_ID2-1 group by a.ITEM_ID,'
      +' a.ITEM_NAME order by a.ITEM_ID ';
    Active:=true ;
  end;
  cds_Print.DisableControls;
  p:=cdsPrint.GetBookmark;
  FrfStr:='report1l.frf';
  try
    if cdsPrint.Active and (cdsPrint.RecordCount<>0) then
    begin
      frReport1.LoadfromFile(ExtractFilePath(ParamStr(0))+'Report\'+FrfStr);
      PrintSet;
      frReport1.ShowReport;
    end
    else
    begin
      Screen.Cursor:=crDefault;
      Application.MessageBox(pchar(STR_MESSAGEBOX_HEADER+'ûÓÐÊý¾Ý¿É´òÓ¡'),pchar(self.Caption),MB_OK or MB_ICONEXCLAMATION);
    end;
  finally
    cdsPrint.GotoBookmark(p);
    cdsPrint.EnableControls;
 &nb


Ïà¹ØÎĵµ£º

sqlÖеÄÓαê

declare @id varchar(10)
declare @nm varchar(10)
declare @table as table(emp varchar(10),empname varchar(10))
declare CurEmp cursor for select top 6 empid,empname from employee
open CurEmp
fetch next from CurEmp into @id,@nm
While @@fetch_status=0
 begin
  insert @table(emp,e ......

SQLÓïÑÔ»ù´¡¿¼ºË(Ò»)(oracle)

 1.ÀûÓÃÏÂÃæµÄ½Å±¾´´½¨BOOK£¬READER ºÍ BORROW ±í£¬²¢Íê³ÉºóÃæµÄÁªÏµ¡£
CREATE TABLE BOOK(
    NO CHAR(8) PRIMARY KEY,
    TITLE VARCHAR2(50) NOT NULL,
    AUTHOR VARCHAR2(20) ,
    PUBLISH VARCHAR2(20),
    PUB_DA ......

SQL SERVER Ò×»ìÏýµÄÊý¾ÝÀàÐÍ

 (1)char¡¢varchar¡¢textºÍnchar¡¢nvarchar¡¢ntext
charºÍvarcharµÄ³¤¶È¶¼ÔÚ1µ½8000Ö®¼ä£¬ËüÃǵÄÇø±ðÔÚÓÚcharÊǶ¨³¤×Ö·ûÊý¾Ý£¬¶øvarcharÊDZ䳤×Ö·ûÊý¾Ý¡£Ëùν¶¨³¤¾ÍÊdz¤¶È¹Ì¶¨ µÄ£¬µ±ÊäÈëµÄÊý¾Ý³¤¶ÈûÓдﵽָ¶¨µÄ³¤¶Èʱ½«×Ô¶¯ÒÔÓ¢ÎÄ¿Õ¸ñÔÚÆäºóÃæÌî³ä£¬Ê¹³¤¶È´ïµ½ÏàÓ¦µÄ³¤¶È£»¶ø±ä³¤×Ö·ûÊý¾ÝÔò²»»áÒÔ¿Õ¸ñÌî³ä¡£ text´ ......

SQLÓïÑÔ»ù´¡¿¼ºË(¶þ)(oracle)

 2.¸ù¾ÝOracle Êý¾Ý¿âscott ģʽϵÄemp ±íºÍdept ±í£¬Íê³ÉÏÂÁвÙ×÷£º
      (1) ²éѯ20ºÅ²¿ÃŵÄËùÓÐÔ±¹¤ÐÅÏ¢£»
      (2) ²éѯËùÓй¤ÖÖΪCLERK µÄÔ±¹¤µÄÔ±¹¤ºÅ¡¢Ô±¹¤ÃûºÍ²¿Ãźţ»
      (3) ²éѯ½±½ðCOMM ¸ßÓÚ¹¤×ÊSAL µÄÔ±¹¤ÐÅÏ¢£»
  ......

sybaseÊý¾Ý¿âÖÐË÷Òýµ¼ÖÂsqlÓï¾äÖ´Ðв»³É¹¦

SELECT DISTINCT A.CASEPROP AS PROP,'¾É´æ' AS AJLX,0 AS AJLXXH,A.CASE_PROP AS PROPNO 
 ,M1=( SELECT COUNT(*) from CASES WHERE CASEPROP=A.CASEPROP AND
(PERMITDAY <'2008.12.26 00:00:00' AND (SHUTDAY IS NULL OR
SHUTDAY<'1900-01-01 00:00:00' OR SHUTDAY>='2008.12.26 00:00:00') )) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ