Questions tagged as 'sql'

1
answer

MySql DELETE using SUBQUERY with same table in FROM

Database manager system: MySql 5.7.11 I'm trying to create a SQL query to delete all the records that meet the following condition: This is a tariff system, a tariff table is related to the price table in a one-to-many relationship, and ea...
asked by 10.07.2016 / 18:25
1
answer

Correct CASE structure in SQL Server

I have the following query: SELECT *, CASE PORCENTAJE_CRUCE WHEN PORCENTAJE_CRUCE >= 80.00 AND PORCENTAJE_CRUCE <= 85.99 THEN 2000 WHEN PORCENTAJE_CRUCE >= 86.00 AND PORCENTAJE_CRUCE <= 90.99 THEN 3000 WHEN PORCENTAJE_CRUCE >=...
asked by 27.08.2018 / 17:16
2
answers

Search data in Sql and display them in C # ComboBox

Good afternoon. I would like to know how I can show data in ComboBox . This data I look for in SQL and I show them in a DataGridView but I would like to show it in a ComboBox , this is what I have of code. public DataTabl...
asked by 25.11.2016 / 21:54
2
answers

query to obtain maximum date between several tables

Is it possible to obtain the most recent date among several tables, given the id of a main table that is in all the other tables? How could I get this? Table 1 main id_tabla1 descripcion table 2 id_tabla2 fecha fk_tabla1 table 3...
asked by 13.12.2016 / 15:35
3
answers

How to check existence of records in mysql with php?

I'm doing a class work in which they ask me to make a record system, to insert the user's data in a database, I have the following function: function comprovaUsuari($user, $passwd){ $servername = "localhost"; $username = "root"; $d...
asked by 28.03.2018 / 12:54
2
answers

Query MySql delete from

In the database I have. Coches(matricula,año,modelo) Es_Dueno(id_conductor,matricula) Persona(id_conductor, nombre, direccion) and I want to delete the model car Mazda of the client Santos I made the following query: DELE...
asked by 24.11.2016 / 16:40
1
answer

Replace characters in a field in SQL Server

My question is this, I have a field called titulo whose records are all university title names. Some contain ñ , other letters with accents. I imported it from a csv that already came with errors and my intention is to cle...
asked by 20.07.2017 / 22:46
1
answer

Concatenate values resulting from an INNER JOIN in a string separated by commas in SQL Server 2012

I have the following schema in SQL Server 2012: Tabla 1 Id INT PRIMARY KEY Descripcion NVARCHAR(20) Tipo INT Tabla 2 Id INT PRIMARY KEY Nombre NVARCHAR(80) IdTabla1 INT --Llave foranea a la primera tabla Tabla 3 Id INT PRIMARY KEY Nombre NV...
asked by 09.11.2016 / 16:52
4
answers

Bring data from a table whose date is less than the smallest in another table

I want to do an SQL query to see certain 'inconsistencies' in a SQLServer database. To simplify it a bit, let's say that I have a table Movimiento_Paciente that contains a field pacienteId and another fechaInicio . In this...
asked by 25.10.2018 / 15:15
2
answers

How to copy the data of one table from one database into another database with an identical table?

Greetings to all, friends. I have the following problem: I just assumed the administration of an old system which manages 4 databases (different names, identical structure) but the only common table in structure and data is that of Users....
asked by 01.03.2017 / 19:23