Questions tagged as 'sql'

0
answers

CTE with subqueries in anchor and recursive call

It turns out that I have these three tables, Users(id, name) Colleagues(id1, id2) Friends(id1, id2) I need to write a query that gives me pairs of ids so that one can "get" from id1 to id2 with an arbitrary numbe...
asked by 29.06.2018 / 22:48
1
answer

How to optimize a query that contains two subquery in MySql?

I have the following query: SELECT presupuestosd.partida,presupuestosd.valor, (SELECT SUM(presupuestosa.comprado) AS comprado FROM presupuestosa WHERE presupuestosa.obra=18 AND presupuestosa.empresa=1 AND presupuestosa.partida=presupuestos...
asked by 29.06.2018 / 18:27
2
answers

Do not show certain records in an sql query

I am making a system of online courses, and in the list of all courses offered to the public I would like to ignore what the user in session has already purchased. I have two tables that are: Courses: |-----------|---------------|-----...
asked by 09.05.2018 / 05:47
1
answer

Undefined offset in PHP

Let's see if you can help me that for many laps I give, I can not find the error. The attached code returns me:    Notice: "Undefined offset: 0 in   /var/www/vhosts/16/181528/webspace/httpdocs/sur-madrid.es/alumnos/Richard/Marcas/Administrato...
asked by 09.05.2018 / 10:59
0
answers

Update data from one table from others but only to specific users

I am trying to update a table and in the condition I am making two subqueries to validate that the data exists. If I run my queries separately, it shows me the following: SELECT m.id AS membersid, m.name AS username, s.name AS skillname...
asked by 11.05.2018 / 19:01
1
answer

Pass parameter value to query before running in power bi

I am looking for a query to extract data from sql but I would like to know if power bi has the functionality of passing the value of a parameter in for example: start date and end date to the query and that this value is captured by the user bef...
asked by 25.04.2018 / 01:47
2
answers

Error counting list with PHP count

I have this function that brings me the tickets associated with a user_department of the user that enters the system function listTicketUnrevisedSupervisor($conexion, $id){ $consulta = mysqli_query($conexion, "SELECT *, t.id as id_ti...
asked by 24.04.2018 / 15:55
0
answers

How can I enter data from a DataGridView to an SQL table through Linq?

I have to fill a table with the data from a DataGridView but I can not do it, I pass the data to a first DataGriView. All this with LINQ After filling the first DataGriView I want the "Save Week" button to save the data in SQQL and show...
asked by 12.05.2018 / 19:27
0
answers

How are restrictions made in SQL?

I have this code to generate a table Create table "Socio" ( "Dni" Char(20) NOT NULL, "Correo" Char(40), "Nombre" Char(20), "Contrase_a" Char(20), "Puntos" Numeric Check (puntos >=0), primary key ("Dni") ) Without Oids;...
asked by 13.04.2018 / 19:53
1
answer

Fatal error when generating excel with PHPExcel and SQL ... "Call to a member function query () on a non-object .."

My problem in particular is that I must generate an excel [.xlsx] (use PHPExcel) with data from SQL Server with PHP. The script that I edited already existed with MySQL statements and it worked perfectly, but when I change the sentences by SQ...
asked by 13.04.2018 / 15:53