Questions tagged as 'sql'

1
answer

Extract two fields from a SQL table with JOIN in PHP

The problem is this, I want to get 2 fields out of a table. This is the part of the page that should show the results. Here is the code for that part: <div class="panel panel-info"> <div class="panel-heading text-center...
asked by 30.05.2017 / 04:09
2
answers

List query in MySQL

I am trying to perform a MySQL query from CodeIgniter, and the query goes fine but I would like to add a field within the select that counts the records that the query returns. SELECT r.fecha_inicio, r.fecha_fin, c.Nombre as cliente FROM reser...
asked by 30.05.2017 / 02:55
1
answer

Trigger to calculate hours pl / sql

Good morning everyone and thanks in advance for the time you gave me; My problem is the following one I have to program a trigger in my database that calculates the excess of hours or in its defect the hours of less and skips a warning. I'...
asked by 10.05.2017 / 15:41
0
answers

Must declare the scalar variable "@pList"

I need to pass a list of Id's to WHERE of a UPDATE , iterating and doing a UPDATE at the same time, these I get from doing INSERT to a table type TYPE with a value as type INT . Something like this: D...
asked by 12.05.2017 / 23:29
2
answers

Get temporary table from executing an EXECUTE sp_executesql

I have the following query: DECLARE @QUERY NVARCHAR(400)=' INSERT INTO #AA(ID) SELECT ID FROM BB ' DECLARE @CREATETABLE NVARCHAR(400)=' IF OBJECT_ID(''tempdb..#AA'') IS NOT NULL DROP TABLE #AA CREATE TABLE #AA ( ID INT ) ' EX...
asked by 19.05.2017 / 23:33
0
answers

Oracle query error

Hi, I have this query but I miss an error saying that parentheses are missing right: select to_char(trunc(fecha,'HH')+(30*round(to_char( trunc(fecha,'MI'),'MI')/30))/1440,'DD/MM/YYYY hh24:mi:ss') AS fecha, SUM(total) AS total from (S...
asked by 31.07.2017 / 20:32
2
answers

First registration of a foreign key

Good morning classmates I need to know how I can identify when the first record of a relationship is created, I have 2 related tables the main table has idclase primary key and the second table with its foreign key idclase and primary key id tes...
asked by 31.07.2017 / 18:48
1
answer

Data management arrays, maps - CVS

I have several questions about how to handle a record module in my application, since the requirement indicates that a CVS file should be loaded with approximately 18mil to 20mil records . The file must be loaded in a JSF application, with...
asked by 05.06.2017 / 05:11
1
answer

Linear SQL query without importing fields, is it possible?

Is it possible to make a query, which created columns automatically according to the data, regardless of the condition? Let me explain: I have a table of surveys, another table that contains the questions that are made by surveys and other...
asked by 18.05.2017 / 19:28
1
answer

(SQL) perform Inner Join via conditional

I am trying to make a query of three tables in my MariaDB of a gym: Clases Instructores Usuarios What the query asks me is the following:    "Know which is the class that has more students and display" class ",   "Full name of the instr...
asked by 03.05.2017 / 18:18