Questions tagged as 'sql'

3
answers

SQL query by data type

I have the following query: SELECT COUNT(co.sexo_id) as TOTALDIA, se.SEXO FROM CONDUCTORES co JOIN TRAMITE tr ON co.conductor_id=tr.conductor_id join LICENCIAS lic on tr.licencia_id=lic.licencia_id jo...
asked by 05.09.2018 / 19:30
3
answers

Insert records in the form of a table

Good afternoon, I am working on a restaurant system in C # using Windows Forms, which is the part of taking the order: What I want to achieve in inserting this order in table form in SQL SERVER In the following table: and how I...
asked by 28.09.2018 / 00:46
2
answers

How to convert a data of type string, to convert it into minutes? Using SQL Server and MySQL

I want to convert a data of type varchar to int, then I want to convert the result to minutes to get an average from there. This is the field: RalentiTiempoTotal 01:06:10 What I am doing first is separating the fields in this way: sel...
asked by 16.03.2017 / 19:15
4
answers

How to show records between two dates?

I need your help to formulate a query that allows me to show the months per year between two dates. I have a table called acquisitions where I keep the id_adquisicion and fecha_adquisicion Acquisition Table: TBL ADQUISICIÓN id...
asked by 03.03.2017 / 05:50
2
answers

Extract VARCHAR inside another VARCHAR in SQL Server

My question is very simple but requires a bit of programming, easy for some, complex for me at this time. I have a table that gives me these examples as an example: +--------------------------------------------------+ | Da...
asked by 26.04.2017 / 17:27
2
answers

ORDER BY, how to order salary amount

good day guys my doubt is this I put the syntax with its respective order by desc to show me the gain from highest to lowest but I keep ordering them randomly: ( SELECT month(s.fInicio)AS [MES],a.Nombre_auto, SUM(DATEDIFF(d, dateadd(d, -1, s...
asked by 31.10.2018 / 16:55
3
answers

How to get the number of times a word is repeated in MYSQL

How can I get the number of times the word "false" is repeated, in a column from mysql. example: id | read | ------------- 1 | false | ------------- 2 | true | ------------- 3 | false | ------------- 4 | false | -------------...
asked by 15.09.2018 / 21:11
2
answers

know the auto_increment of a MySQL table after deleting the last ID's?

Friends, I come to you to know who tells me how to know the auto_increment of a table. Suppose that id_campo has 30 values, but after 6 rows is deleted, it would be in id_campo (24) , but the auto_increment is at 31. Is there...
asked by 24.10.2017 / 21:00
2
answers

Problem with COUNT (*) Does not return data (PHP AND MYSQL) [closed]

I try to count the amount of invoices in the database: //conexion: $con=@mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); if(!$con){ die("imposible conectarse: ".mysqli_error($con)); } if (@mysqli_connect_errno()) {...
asked by 27.04.2018 / 17:38
2
answers

SQL using LIKE within a variable

Good friends, I want to know how to use like inside a variable to know if there are 6,7,8 numbers. Does anyone know what would be the correct syntax for this case? @listaMenus = '4,5,6,7,8,9,10' if (@listaMenus like '%8%' or '%6%') begi...
asked by 10.09.2018 / 22:57