Questions tagged as 'sql'

1
answer

Reuse stored procedure sql server

I'm trying to reuse the result of a procedure so I do not call it twice again, because it takes too long to do so. select DW.dbo.procedimiento(CONVERT(char(10), FecLlamada, 103), CONVERT(char(5), HorLlamada, 108)...
asked by 18.12.2017 / 17:38
1
answer

Consult xml file from sql server with OPENROWSET

I'm doing a query to an xml file from a store procedure and when placing the direct route it works. the problem is that the route I want to pass it by parameters and throws me error when placed as variable DECLARE @XmlFile XML SELECT @XmlFile...
asked by 18.12.2017 / 14:04
1
answer

missing error a parenthesis to the right ORA-00907

Hi, I'm a newbie in sql code and they ask me to create tables with sql. When creating the table I get the error of missing a parenthesis on the right ORA-00907 and I can not find the cause. This is the structure that I have created. create...
asked by 28.11.2017 / 20:09
1
answer

Infinite loop of mysql

I have to take out a stored procedure, to simplify fractions (divide by the same numerator and denominator number). However, when I run the script it stays running for a while and the MySQL connection is cut off. My code is as follows: deli...
asked by 29.11.2017 / 00:25
1
answer

SQL Bring top 1 or max

I have the following query: select top 1 fact.vend, fact.cliente, sum((detalle.precio-art.costo)*cant) as total from afacturas as fact inner join afacart as detalle on fact.comprob = detalle.comprob inner join aarticulos as art on detalle.cor...
asked by 26.11.2017 / 16:44
1
answer

Remove structure from all Oracle SQL tables

With the following SELECT I see all the tables of a user: SELECT table_name FROM all_tables where owner='usuario1' Result: TABLE_NAME ---------- USUARIOS PRODUCTOS CLIENTES ...(+300 tablas) And with the statement describe...
asked by 21.11.2017 / 14:18
1
answer

How to show a start and end range grouped by states in MySql?

I have a table called documents with three registers id, number, state. What I want to do is get a query with the intervals (min and max) for each record. To be more descriptive if the table is filled, with the following data: | numero...
asked by 21.11.2017 / 06:05
1
answer

How can I export data from a table separated by; instead of,

Hello, I am trying to export a table but automatically exporting it as a field terminator ',' and what I would like to follow is that the field separator is ';'. For this I am using a stored procedure. What I get is: Part_Number, Too...
asked by 05.01.2018 / 07:16
1
answer

How to execute this query in Oracle 10g?

I have this query SELECT EMPNO, ENAME, HIREDATE, DEPTNO, ROWNUM AS rn FROM (SELECT EMPNO, ENAME, HIREDATE, DEPTNO FROM EMP ORDER BY HIREDATE DESC) WHERE rn < 3 but the error is:    ORA-00904: "RN": invalid identifier   00904. 00000 -...
asked by 01.11.2017 / 06:56
1
answer

Problems with a query

I have some problems with a Query that I can not get out, the structure of the tables is as follows: child child_id ----->CLAVE PRIMARIA child_name birth_date gender address city letter letter_id --->Clave p...
asked by 29.10.2017 / 21:22