Questions tagged as 'sql'

2
answers

Obtain unrelated data from each other

I'm trying to get the data that is not related through a query between three tables, but I have not achieved the feat. In my case I have three tables Marcas Categorias Asignacion (It is the intercept table between Br...
asked by 14.10.2017 / 04:30
1
answer

Problem with classifying data in SQL

SELECT libro.titulo AS "Titulo Libro", sum(ventas.cantidad) AS "Cantidad_Comprada" FROM libro left JOIN ventas ON libro.id = ventas.id_libro GROUP BY libro.titulo I just want to show those elements that have a quantity of sum (sales.quant...
asked by 03.10.2017 / 18:56
1
answer

How to insert data in a single column?

I want to insert in a table column T_tiphab but I can not tell me:    ERROR 1452 (23000): Can not add or update a child row: a foreign key constraint fails ( reservas . T_tiphab , CONSTRAINT T_tiphab_ibfk_1 FOREIGN K...
asked by 05.01.2018 / 01:34
1
answer

Queries with DATETIME

I want to return the following values as shown below: fechaActual Clave Usuario Depto entrada salida sumaHoras 201712 307 USER1 TTT 06:00:04 14:04:12 8 The query must take the current d...
asked by 04.01.2018 / 06:16
1
answer

Divide data from different tables in sql

I'm doing an sql query to get averages of accesses for which I first make a query to extract all the accesses of a table and divide them for another field of a different table. The first table is called TrackEvent and from it I extract a colu...
asked by 25.09.2017 / 23:48
1
answer

how to transpose columns and show percentage? SQL server

This is my code: select ROW_NUMBER() OVER (ORDER BY p.CodPersona) AS Numero, ccc.Descripcion AS Curso, p.CodPersona AS Codigo, p.NombreCompleto AS NombreAlumno, cc.Detalle AS Detalle,...
asked by 25.09.2017 / 18:57
2
answers

executenonquery in C #

Greetings, I would like to know what value returns me executenonquery in case I do not affect any field, example string respuesta = ""; SqlConnection SqlConexion = new SqlConnection(); try { SqlConex...
asked by 31.10.2017 / 13:54
1
answer

convert sql result into two-dimensional array in php

I want to put the results of an sql query in a two-dimensional array. The table would be something like id - > 1 name - > pepe last- > Garcia and other fields ... and I want you to put it in a two-dimensional array array [index] ['same...
asked by 01.11.2017 / 13:46
1
answer

Error executing script using BLOB SQL

I have the following script that does what it does: it takes out the contents of a word, and puts it in a blob. But when I run it, I get these errors.    -ORA22275 - > LOB locator not valid -ORA06512 - > Line 29   (DBMS_LOB.fileopen (l...
asked by 08.09.2017 / 12:47
1
answer

Generate data matrix with LEFT JOINS in SQL Server

Good afternoon ... I have this temporary table with the following structure: create table ##PAC_ID_TEMP ( Id INT PRIMARY KEY IDENTITY(1,1),NHC varchar(30), Id_Ficha_IOS int) CREATE NONCLUSTERED INDEX Idx1 ON ##PAC_ID_TEMP(NHC); Which I use...
asked by 18.09.2017 / 22:07