Questions tagged as 'sql'

1
answer

How to insert quotes to the key in a query with "JSON_OBJECT"? from mysql

I use this query: JSON_ARRAYAGG(JSON_OBJECT("id",pd.id_pedido_detalle,"cantidad",pd.cantidad,"precio",pd.precio_pedido)) This gives me the following result: [{id: 991, cantidad: 1, precio: 10}, {id: 992, cantidad: 1, precio: 20}] I try...
asked by 26.12.2018 / 19:51
1
answer

Is it possible to prevent a job from running again while still performing tasks?

I need to create a Job on sql server that runs every 5 minutes. The job must execute a stored procedure that verifies some records in the database, which, depending on its status, must perform the execution of other stored procedures. The proble...
asked by 26.12.2018 / 22:38
1
answer

How to concatenate a value to enter it in an update?

I have a query, I'm trying to concatenate this update update tdato set valor= (select max(valor)+1 from tdato) the value that returns me plus a text, try trying to contact it in the following way: update tdato set valor = ('AG-')+convert(...
asked by 05.12.2018 / 20:11
2
answers

recursive MySQL query

Good afternoon colleagues, I hope you can help me with this query that drives me crazy. You will see I have a table with data like these And I need an SQL query I order the data in this way Vertebrates Mono Cat Dog Horse M...
asked by 18.04.2017 / 04:09
1
answer

How to count the columns that were updated in a trigger?

I have the following table called Movies : (id int, nombre varchar(50), genero varchar (50), clasificacion char(1), año int) I have this trigger to validate that only one field can be updated at a time in that table. Would there be a...
asked by 22.11.2018 / 06:06
2
answers

Make php lists in a table

I have the following requirement I need to associate all the data of common expenses of the month with each user, besides that if you have not common expenses these are individual associate in a td to that user, and in the end it shows how much...
asked by 30.11.2018 / 00:45
2
answers

decimals from c # to sql server

rephrase my question that is more accurate, I try to insert a decimal from c # to sql server. This is the click event of the button save the connection but does not do it private void btnBunifuGuardarCargoDirecto_Click(object sender, EventA...
asked by 13.11.2018 / 20:55
1
answer

exclude data in my sql search

I have a function that searches me in my database work with mysql function listUser($conexion){ $consulta = (mysqli_query($conexion, "SELECT *, p.nombre as personaNombre, p.id as idPersona, d.nombre as nombreDepartamento, u.id as idUs...
asked by 06.11.2018 / 01:13
1
answer

Call a SQL Server stored procedure from PHP

What I want to do is call a stored procedure done in Sql Server to PHP, I checked the PHP manual in which the SQLSRV is used, I was guided by that manual but I get an error and the truth is not much and I want you to help me. Then my p...
asked by 05.11.2018 / 23:58
1
answer

Words with length three

I want to make a query that erases the words with length less than 3, that is to say in the phrase "alambre de puas 25 km" that remains "alambre puas" , I tried this query but it does not work. Any ideas? Select REGEXP_REPLACE(col...
asked by 26.10.2018 / 20:20