If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > error between

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-09, 07:40
rafaelmota rafaelmota is offline
Registered User
 
Join Date: Mar 2009
Posts: 2
error between

Friends I am trying to do a ceiling in db2 to me that it always lists the 20 items primireiros actually want to do a layout the same as google did the following select

Quote:
Select * from (select s.NUM_SERV,DATA_SERV,DRT_SERV,NOME_SERV,STATUS_SER V,verifica,DATA_APROV,DATA_BAIXA,STATUS_APROV,DRT_ APROV,
NOME_APROV,d.data_direcao,d.drt_resp1,d.drt_analis ta1,d.nome_resp1,d.nome_analista1 from db2admin.servicos s left join db2admin.direcionamento d on
s.num_serv = integer(d.num_serv) where status_aprov = '1' and s.STATUS_SERV <> 1 and substr(s.data_serv,7,2) > '07' rownumber () over( order by NUM_SERV desc ) AS seqNumber FROM myTable) tabela_temp row_next between 0 and 20
but it is returning me an error, could someone help me?
Reply With Quote
  #2 (permalink)  
Old 03-09-09, 13:37
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Please format your SQL code by using new lines and indentions before debugging it.
You can find easily syntax errors in your code.
One example is following.
Code:
Select *
  from (select s.NUM_SERV
             , DATA_SERV
             , DRT_SERV
             , NOME_SERV
             , STATUS_SER V
             , verifica
             , DATA_APROV
             , DATA_BAIXA
             , STATUS_APROV
             , DRT_ APROV
             , NOME_APROV
             , d.data_direcao
             , d.drt_resp1
             , d.drt_analis ta1
             , d.nome_resp1
             , d.nome_analista1
          from db2admin.servicos s
          left join
               db2admin.direcionamento d
           on  s.num_serv = integer(d.num_serv)
         where status_aprov = '1'
           and s.STATUS_SERV <> 1
           and substr(s.data_serv,7,2) > '07'
        rownumber () over( order by NUM_SERV desc ) AS seqNumber /* ????? */
   FROM myTable) tabela_temp  /* ????? */
 row_next between 0 and 20   /* ????? */
;
Reply With Quote
  #3 (permalink)  
Old 03-09-09, 14:50
rafaelmota rafaelmota is offline
Registered User
 
Join Date: Mar 2009
Posts: 2
Thanks

Thanks tonkuma, worked with this query. You could improve the performance of the consultation this query?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On