Results 1 to 3 of 3

Thread: error between

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Unanswered: 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

    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?

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    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   /* ????? */
    ;

  3. #3
    Join Date
    Mar 2009
    Posts
    2

    Thanks

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •