Questions tagged as 'query'

2
answers

undefined is not a function in Node.js using Mongoose

I know that this error can have several causes, but I can not know so far. I have a function to save a Document in my MongoDB and I am using callback for this. The code is executed until the new document is saved, after that I have an error. The...
asked by 22.07.2014 / 20:39
1
answer

Know the position in a listing

I'm using this query to know how many comments a user has made: $comentarios = $pdo->query("SELECT * FROM topicos_comentarios WHERE autor='".$ver['autor']."'")->rowCount(); However, I would like to know what his position in the over...
asked by 28.05.2017 / 21:46
2
answers

word occurrence in sql query

I have a query SELECT NOME FROM PESSOA WHERE CODIGO = 1 It returns me ANA ANA JOAO ANA ALBERTO ANA Is there a way to count the occurrences of the ana? Using only the sql query?     
asked by 18.03.2017 / 21:00
3
answers

Get value of a variable in Sql Server

I have this Sql block: SET NOCOUNT ON; Declare @QueryString as NVarchar(4000), @Datazero as varchar(20), @Datamn as varchar(20), @CdUsuario as integer, @SitProcesso as int ,@DsUsuarioRede varchar(20) ,@Processo as int...
asked by 10.03.2015 / 15:21
1
answer

Correctly insert data into table

I'm having serious problems with INSERT of PDO , I can not add values correctly to banco de dados , how do I do this? Problem Image: Ilookforwardtohelpingyou.<?phpif(isset($_POST['btn-send-ticket'])){$name=filter_input(...
asked by 28.01.2016 / 22:19
1
answer

Multiple SQL Query

I'm not very experienced with SQL language, how could I make a query work this way: SELECT *, ( SELECT marca.* FROM marca WHERE marca.id = produtos.id ) AS nome_marca FROM produtos WHERE id = 5 What I want to return is all * of table...
asked by 07.12.2018 / 19:51
1
answer

How to create rule in MYSQL to divide the value of one column by another?

I want to know the average values (value2) in a table using AVG () (or another form). I have a table in MYSQL with the columns id, total_value, valuem2 (Value per m²), and area. In some lines the value m2 is empty and in others the total v...
asked by 07.08.2018 / 19:59
2
answers

Help Query Sum

I'm trying to retrieve a column and make a sum - using SUM - according to the time range, but without success. Can you help me with this question? Detail: I'm not exactly using a table, but I call a function in SQL . The application w...
asked by 26.07.2018 / 00:57
1
answer

Query MySQL three tables

I'm trying to make an query in the MYSQL database, but the query is not coming back what I wanted. I want to make a query where I return all modules and modules that the company has with the where clause in Empresa_ID . MySQL Att...
asked by 08.06.2018 / 16:34
1
answer

Subselect without condition WHERE

I need to do a list with sub select, and I even managed to do it using a condition, but I need to do it without condition with the condition would look something like this: SELECT *,(SELECT PLACA from veiculo WHERE ID_CARRO = "1654641106")...
asked by 09.05.2018 / 03:58