PDA

Ver la Versión Completa : Funcion Rows en una subconsulta


juanpe
21-06-2007, 10:03:48
Buenos dias,
¿Alguien sabe porque la funcion Rows no se admite en una subconsulta?

delete from estudios where id_paciente in (select id_paciente from estudios group by id_paciente having count(estudio) = 1 rows(3))

uso Interbase 7.5.
Gracias.

juanpe
22-06-2007, 10:34:22
Buenos dias, espero que os sirva.

Mi gozo en un pozo.

Q. Are ORDER BY and ROWS allowed in subqueries?

A. A sub-query, also called a select expression, is a form of table expression. Standard SQL syntax does not specify ORDER BY clauses for any table expression. Standard SQL only allows an ORDER BY with a CURSOR declaration to affect the order in which a result set's rows are returned to the user. For these reasons, InterBase does not allow ORDER BY or ROWS in a subquery. A syntax diagram of what is allowed in a subquery may be found in Chapter 6 of the Embedded SQL Manual with InterBase 6 and 7.

Fuente. http://dn.codegear.com/es/article/30296

Asi que ya lo sabemos todos.

Un saludo.