Questions tagged as 'sql'

3
answers

SQL Count records that begin with xxx

I want to count the records in column 1 that start with 123, I need to count multiple times, with different values (123, 657, 897, ...) I have the values in column 2 - column1 | column2 - 1234567 | 123 - 5489186 | 135 - 1238756 | 548 SELE...
asked by 14.03.2018 / 11:15
1
answer

SQL query to fix badly coded accents

For an error, I have entered records in a table with the accents of the type о, о. Normally we save the records with the correct accents. So I would like to know if there are any questions that you can apply to the table to replace those or...
asked by 14.09.2018 / 12:31
2
answers

Check MySQL duplicate records (only the first two)

Good morning, I'm new to subqueries, I have a table that registers ip addresses of computers connected to the day, my idea is to list only the first two or a computer corresponding to an ip address I explain (table equipment) my curr...
asked by 23.10.2017 / 06:37
1
answer

Validate form without deleting the data

Good I have a simple form, I want to validate the fields are not empty and that the ID is not duplicated, but at the same time that those fields that are well entered are not deleted. I have the following code. <script>...
asked by 15.09.2017 / 16:09
3
answers

Take the max out of a column according to the max of another SQL server

Good I have a query where I have to make a select that gives me the maximum of one column depending on the maximum of another, I explain myself better with the following example my table would be like this: |nrocon|ordren|ordamp| | 1 |...
asked by 11.04.2018 / 20:43
2
answers

In a query Is it possible to fill a field with all the records of another table?

I am making a query and in a field of that query I want to concatenate or extract all the data that is in another table. Is it possible to do this? This is the query I'm doing: SELECT r.id_resg as 'CLAVE RESGUARDO', -- AQUI QUISIERA...
asked by 05.11.2016 / 22:18
3
answers

Consult concatenated column

I have the following sql query that works fine. SELECT C.id AS id, concat(C.apellido_paterno," ",C.apellido_materno," ",C.nombres) AS nombre_completo, C.agente AS agente, G.genero AS genero FROM cliente_tabla AS C...
asked by 08.11.2017 / 18:45
4
answers

My Update does not work

I'm trying this: <?php session_start(); require 'conexion.php'; $nombre = $_POST['nombre']; $emai = $_POST['emai']; $pass = $_POST['pass']; $tel = $_POST['tel']; $dir = $_POST['dir']; $id = $...
asked by 11.11.2017 / 14:36
2
answers

Error when storing a file in SQL

Hi, I am trying to make a query INSERT from C # when I parcer I have a syntax error, but I do not see it. Could someone tell me if I can notice what it is, or what am I doing wrong? //KyoTest [HttpPost] public JsonResult KyoTest(t...
asked by 07.11.2017 / 21:29
2
answers

How to create a delete trigger in SQL Server2012?

I have a table called Productos in which I want to create a trigger which does not allow to delete a record when the existence of this product is greater than 0 I tried the following: go create trigger ProductoExistencia on...
asked by 01.12.2016 / 19:27