Questions tagged as 'sql'

1
answer

The best way to endorse a table by periods [closed]

I have a table ( tabla_1 ) that is constantly edited with certain values and I want to be able to keep a searchable record of these same data of their state in periods of time gone by. I am considering creating a second table ( tabla...
asked by 07.07.2018 / 00:31
1
answer

Is it possible to make this query in linq?

SELECT CL.ClNIt, CL.ClNombresApe, VS.VsFeha, VS.VsValorNeto, VS.VsValorVisita,SUM(CC.CcValor) AS SumCupos, CL.ClSaldoCupo FROM Visitas VS INNER JOIN Clientes CL ON VS.ClNit = CL.ClNIt INNER JOIN CuposCliente CC ON CL.ClNIt = CC.CcClNit WHERE CL...
asked by 31.07.2018 / 05:10
2
answers

Someone can explain this LINQ of C # (more than all the "!" sign and contains) and convert it to a SQL Server Query [closed]

q = (from c in db.CopiasDelLibro where c.LibroId == idLib && !(from a in db.AlquileresDelLibro where a.FechaRealDevolucion.Year == 1900 select a.CopiaDelLibroId).Contains(c.Id)...
asked by 31.07.2018 / 05:15
2
answers

join brings me more data

I am making a query to 2 tables the main table t_person has 128176 records and the table t_evaluation has 135839 the evaluation table can have several times the code of the person since a person can have 1 or more evaluations What I need to do i...
asked by 10.07.2018 / 17:48
1
answer

Obtain number of bits from two simultaneous fields with bit_length () in SQL

How can I get the number of bits in two fields in sql with Bit_Length() . I have a table with four fields I want to print all fields but only two get the number of bits id, name, birthday and surnames, I want the 4 fields but I want...
asked by 28.06.2018 / 06:49
2
answers

query sql that counts how many days of each month there are two dates grouped by months

I come to you because I have searched and I have not found anything that can help me with the problem I have. I must show in a query in SQL Server how many days of each month there are between two dates but grouped by months (I have an Initial d...
asked by 04.01.2018 / 14:22
1
answer

Perform a UNION with Codeigniter

Hi, how can I make a UNION in codeigniter, since I want my table to fit between my two tables. Something like that. [array] => Array ( [0] => stdClass Object ( //TABLA 1...
asked by 17.07.2018 / 18:36
1
answer

Select inside where in laravel

The question is that I need to enter a% conditional where , according to the data that is sent to the controller, the question one of those conditions is that I bring the data according to a select , I already tried the query in the manage...
asked by 22.06.2018 / 21:21
1
answer

Subtract 2 dates where one is saved as text

I wish to obtain the total sum of the days from the date of period 25-06-2018. My problem is that the period date can not be modified and added by a third part of a form and the format is: Tabla periodo id periodo1 id 1 d...
asked by 27.07.2018 / 21:39
1
answer

How to handle roles when starting session in php and mysql?

Hello good afternoon, I am trying to redirect the user to log on to the roll to which it is associated within the table, in this case there are two types, the admin roll and the limited roll. I want to know how this could be achieved. So far it...
asked by 16.06.2018 / 20:16