Questions tagged as 'query'

1
answer

Make a query with laravel with the following logic

Hello friends of the community. I need to fill a chart but I can not mount the query to receive the attributes, could anyone help me? The query I need to do is the following. select client.name, count(*) as Tickets from client, ticket where...
asked by 29.07.2016 / 13:51
1
answer

Query with datadiff returning 0 in sql server result

I have the following query: SELECT DATEDIFF(hh, MIN(BATIDA), MAX(BATIDA))AS HORAS FROM ARELBATIDATRANSITOVIEW WHERE CHAPA = 3187 AND BATIDA IS NOT NULL AND SEQUENCIALBATIDA IN (2,3) GROUP BY DATA ORDER BY DATA DESC Example:...
asked by 19.10.2016 / 03:51
1
answer

add specific line in Mysql

Talk about the person! I am inserting a time (hour: minutes: seconds) into an x column, would you like to know if it is possible to add the current value of the line with the next value that is entered? as if it were a + =. For example: One l...
asked by 10.08.2016 / 22:10
1
answer

MYSQL: Find subsequences in a sequence and group by ID

I have a table with the following result: ------------------ |seq | ID | ------------------ | 1 | 12345 | | 2 | 12345 | | 3 | 12345 | | 4 | 12345 | | 8 | 12345 | | 9 | 54321 | | 10 | 54321 | | 11 | 54...
asked by 27.05.2016 / 17:04
1
answer

Using Eloquent hasManyThrough

// Modelo Cliente public function plano() { return $this->hasManyThrough('App\Plano', 'App\Plano_cliente','cliente_id','id','plano_id'); } //Modelo Plano public function cliente() { return $this->hasMan...
asked by 05.04.2016 / 18:09
1
answer

Query does not return results in PHP [closed]

There is a query in my PHP where I search the mailing list and return to PHP, however, it is not returning any results. Code PHP looks like this: <?php session_start("admin"); if($_SESSION["admin"] == "on"){ inclu...
asked by 16.03.2016 / 15:59
1
answer

Fine tuning in Ranking for a game system [closed]

I have a very crazy problem that has already burned my logic ability. Some time ago I asked a question almost the same as this one but they helped me a lot (thank you very much) but my need has changed and now I have another table and my quer...
asked by 23.02.2016 / 17:41
2
answers

PostgreSQL - Query data from a range and bring a boundary of more spaced lines

Good morning guys, how are you? I have a performance problem on a system and need to solve customizing a SQL. Let's imagine the following scenario: - A table with millions of records, each record has an ID (PK) and a TIMESTAMP. I curr...
asked by 31.03.2016 / 15:39
3
answers

SQL Server subquery is always returning null. How to fix.

I have a procedure and a COMMON TABLE EXPRESSION (subquery). This my CTE does a search and offers to my query the result, my query then uses the results of it. In my Address table I have a "Complement" field that allows null values. However w...
asked by 02.12.2015 / 05:05
2
answers

Select within select sorted by second query mysql

I have a problem, I do not know if I'm doing it right, but come on. I have a table that lists some employees (tblTecnicos). I have another table, which has the service registers that these technicians performed (tblServices), in this table...
asked by 04.09.2015 / 17:07