Questions tagged as 'sql'

2
answers

How to transform a SQL query into a panda dataframe matrix?

I want to set an array from a postgresql database so that we have the eclipse_id by the heading and the subscriber_id by the side. > data.head(6).ix[:,2:8] 1222 52582 45552 122 589 568 0 0 0...
asked by 01.06.2017 / 18:30
2
answers

Error: An INSERT EXEC statement can not be nested. SQL Server 2008 R2

I have an sp which I want to store inside a temporary table, either a table variable or a temporary table, in both cases, this error marks me:    An INSERT EXEC statement can not be nested. This is my code that I am generating to store th...
asked by 05.06.2017 / 17:38
1
answer

Discount amounts in SQL without using a cursor (SQL)

I need to discount or download quantities, I have a query that yields the following result: This result I have to download the balance based on the amount, the column to calculate is descontar ; that is, for an article I have an a...
asked by 11.06.2018 / 16:44
2
answers

Thousands Separator

I have this query SELECT CONVERT(numeric(18,0), CAST((g.SI_Existencia) * gg.SI_Costo_Promedio AS MONEY),1) from SI_Inventario_Teorico_QAD g INNER JOIN SI_Maestro_Ref_QAD gg ON g.SI_Articulo = gg.SI_Num_Articulo WHERE SI_Articulo = 200...
asked by 24.07.2017 / 19:20
1
answer

I have a problem inserting a datatable in a sql table (Merge)

My problem is that I want to empty a datatable in a temporary folder of sql, my code already arrives at the moment of executing my stored procedure that executes the insertion of the datatable. Insertion Code in c # try { co...
asked by 22.03.2017 / 17:46
2
answers

Define a default value to a double in mysql?

I have the following table: CREATE TABLE IF NOT EXISTS tab_gas_card ( id INT(11) NOT NULL AUTO_INCREMENT, vehicle_id INT(11) NOT NULL, folio VARCHAR(8) NOT NULL, nip VARCHAR(4) NOT NULL, date date NOT NULL, cost DOUBLE NOT NULL, amount DOUBLE...
asked by 21.06.2017 / 22:39
2
answers

Send image by mail using SQL SERVER 2012

Good, I would like you to help me, I am sending an email using SQL MAIL SQL SERVER which I get the email generated but now I want to attach an image for that I have a table that has a field that stores a Format image IMAGE . When I try...
asked by 13.04.2017 / 01:20
1
answer

Help in SQL statement to update

I was creating a procedure but I came across an error in doing it. create procedure actualizar (in id int, in nom varchar(45), in corr varchar(45)) begin update dpersona set nombre=nom, correo=corr where idpersona=id; end In the part of 'i...
asked by 07.05.2017 / 21:11
2
answers

Oracle SQL SubConsulta

I'm doing a table query / modification exercise. I have two tables: CREATE TABLE CURSOS ( Codigo NUMBER, Nombre VARCHAR2(20), Cod_Profe NUMBER, Max_Alumn NUMBER, Fecha_Inic DATE, Fecha_Fin DATE, Num_Horas NUMBER, CONSTRAINT...
asked by 24.04.2017 / 11:47
3
answers

Error using count in a subquery

I have a query where I use 1 subquery to get data from several tables. And as a result, it returns a total of 2947 records. --CONSULTA INICIAL SELECT dniEgre, (SELECT TOP 1 CASE WHEN numeRespu = 1 THEN 'SI' ELSE 'NO' END FROM OCL.tblDet...
asked by 10.02.2017 / 05:24