Questions tagged as 'query'

2
answers

Make a query with the return of an Ajax

I have a select field and need to query and load the result dynamically with Ajax . I currently have the following code (which does not seem to work or is incomplete) : $('#formProd select').change(function(){ $.ajax({...
asked by 17.03.2014 / 14:08
2
answers

INNER JOIN does not return bank result

I'm trying to use this code: SELECT * FROM tb_trabalhador INNER JOIN tb_detalhe_trabalhador ON Tb_trabalhador.id = tb_detalhe_trabalhador.tb_trabalhador_id And it returns the result in white. Is there a way to get around this with anothe...
asked by 24.02.2014 / 10:32
3
answers

Calculate percentage between two dates MYSQL

Good morning! I wanted to calculate the percentage of how many times a rating appears between two dates, the ratings are distributed in "red," "yellow," and "green." This is the "questionnaire" table: Itrieditasfollows:$percentagem_ver...
asked by 27.06.2018 / 13:57
2
answers

How to get the sum of an entire column in SQLSERVER

I need to get the total value of the VOL field (image below), it is already generated by the SUM function. It can be in another query. All periodic tithe is required. ex: total = VOL (7.6890028) - > sum of the 4 lines of column VOL...
asked by 03.05.2018 / 21:56
1
answer

Direct sum by SQL query

I would like to know if I have a simple sum directly through the query, I have a table that contains a sub-table named VIEWS and I would like every query that I executed these VIEWS to increase +1 without having to exercise much PHP, how can I d...
asked by 05.06.2014 / 04:36
2
answers

Concatenate columns in a single Postgresql row

I have a situation that would make it much easier .. if I could return the data of a specific column in a single line: For example: Table A: Codigo | Descricao ------------------- 1 | Descricao 1 2 | Descricao 2 3 | Descri...
asked by 23.06.2017 / 16:57
2
answers

How to make more than one select in the same query?

How can I make more than one select in the same query? I tried the following (using UNION), but it did not work: DATABASE Table: lines_cameras id_camera_linha | nome_linha_camera Table: Manufacturers id_fabricante | nome_fabri...
asked by 09.01.2017 / 13:23
2
answers

Problem with IN condition in the sub-select

I have the following problem; I'm trying to do a search and include the value of the WHERE principal in a sub-select , however the result is always reported as 0, Part of the query I'm having difficulties is this: SELECT (...
asked by 21.11.2016 / 20:14
2
answers

How to do a record count for each day between one date and another?

I need to make an appointment, to return the number of registrations registered in EVERY DAY, between two dates. I'm using a MYSQL database, and I tried it here, but no form seemed to me correct.     
asked by 14.06.2016 / 16:45
3
answers

How to store in a variable the number of rows found from a MySQL query

I have a Side Menu on my page and I want to display a warning text for the user, indicating when he has new messages and how many. For this I did the query in the DB and it correctly returns the number of records based on the query I set up....
asked by 27.07.2016 / 01:10