Questions tagged as 'mysql'

2
answers

perform subtraction and show the values between 1 and 10

I have a table which contains I have this sentence to get me to subtract fewer exits: $sql="SELECT medicina_inventario,fecha_inventario,entrada_inventario,salida_inventario,total_inventario,inveObservaciones, entrada_inventario-salida...
asked by 09.11.2018 / 14:12
1
answer

Query does not return the expected values

Good morning, I have the following query: select Seg.NombreUsuario, count(RelA.IDSeguidor) as 'Siguiendo', count(RelB.IDASeguir) as 'Seguidores' from Perfiles as Seg inner join Relaciones as RelA on RelA.IDSeguidor = Seg.ID inn...
asked by 17.08.2016 / 16:50
2
answers

Delete repeated records from a table in MySQL

I have managed to show you how many data I have repeated but now I want to make a query to delete the records that have 5 repeated data: student_id, id_curso, semester finalnote and id_seccion. select count(*), uni_notas.id_alumno...
asked by 07.09.2016 / 00:02
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
2
answers

How to make SELECT Top 1 in MySQL for last registration

Good I know that in SQL Server a query is made like this to take the LAST record NOT THE FIRST SELECT TOP 1 * FROM Tabla ORDER by ID DESC This is how I get the last MSSQL table record, SQL server 2008 R2, but in MySQL I...
asked by 01.01.2017 / 18:06
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
3
answers

MySQL - How to count the Date and Time fields of each time slot?

I would like to know how to count the date field (Ex: 2017-03-12 08:14:12 ) that is in the specified time zone (Between 08:00:00 and 08:29:00) and until 18:00:00 and 18:00 : 29: 00 and SHOW ME ZERO "0" when there are no calls. It...
asked by 13.03.2017 / 05:33
2
answers

How can I add hours and minutes?

What I'm looking for is a button that when I click on it, I add the hours and minutes of each record and its total appears in a field, this script is only doing the query of the hours but I do not know how to add them. <?php echo "<b...
asked by 28.05.2018 / 15:06