You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <ji...@apache.org> on 2018/10/17 13:54:01 UTC

[jira] [Commented] (DERBY-7013) ROW_NUMBER() OVER () no me funciona

    [ https://issues.apache.org/jira/browse/DERBY-7013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16653582#comment-16653582 ] 

Rick Hillegas commented on DERBY-7013:
--------------------------------------

The query works for me with Derby version 10.4.1.3 using Derby's ij tool. The following script runs without any errors:

{noformat}
connect 'jdbc:derby:db;create=true';

create table t1(a int);
insert into t1 values (1);
select * from t1;

SELECT * FROM (
   SELECT
     ROW_NUMBER() OVER () AS R,
     T.*
   FROM "APP"."T1" AS T
) AS TR
   WHERE R <= 10;
{noformat}

Maybe this is a Squirrel issue?

Here is my response run through Google translate:

La consulta me funciona con Derby versión 10.4.1.3 utilizando la herramienta ij de Derby. La siguiente secuencia de comandos se ejecuta sin errores:

Tal vez esto es un problema de Squirrel?


> ROW_NUMBER() OVER () no me funciona
> -----------------------------------
>
>                 Key: DERBY-7013
>                 URL: https://issues.apache.org/jira/browse/DERBY-7013
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.1.3
>         Environment: Squirrel 3.8.1 y DerbyDriver 10.4.1.3
>            Reporter: Aitor T T
>            Priority: Blocker
>
> Mi consulta es muy clara, soy totalmente incapaz de ejecutar esto en mi SQUIRREL ver. 3.8.1 con driver para Derby ver. 10.4.1.3, tengo entendido que a partir de esta versión ya se podía ejecutar sin problemas.
> Mi query es esta:
> _SELECT * FROM (_
>    _SELECT_ 
>      _ROW_NUMBER() OVER () AS R,_ 
>      _T.*_ 
>    _FROM "MOSQL"."SSAA_CAIDAS_MAQUINAS" AS T_
> _) AS TR_ 
>    _WHERE R <= 10;_
> Y el error devuelto es este:
> {color:#FF0000}Error: Error de sintaxis: Encountered "(" at line 3, column 24.{color}
> {color:#FF0000}SQLState:  42X01{color}
> {color:#FF0000}ErrorCode: -1{color}
> Estoy desesperado con esto, alguien que le haya pasado y me pueda ayudar....??? Necesito en mi proyecto devolver las "N" primeras filas de una query y no veo manera de hacerlo en Derby.
>  
> Gracias.
> Saludos.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)