Questions tagged as 'query'

1
answer

Postgress Transaction in NodeJs

I want to encapsulate my SQL execution in the Postgress database. My initial desire is to call a method to execute a specific query and another method to execute a multi-query transaction. exports.executaSQL = function (select, listaParametros...
asked by 25.09.2016 / 21:21
2
answers

How to return the number of entities in a table using JPA and the COUNT function?

I'm using the EclipseLink implementation and I can not resolve the following query that should be wrong: Query query = em.createQuery("SELECT e , COUNT(*) FROM Empregado e"); Integer resultado = (Integer) query.getSingleResult(); M...
asked by 10.08.2016 / 19:21
1
answer

Query to get all records regardless of whether or not they exist in another table

I'm running an app from a store where users can leave equipment to be arranged. So I did a php to look for those users who have already left some equipment by name: $sql = mysqli_query("$conexao, SELECT u.contribuinte, u.nome,...
asked by 27.07.2016 / 17:57
1
answer

Include with parameters

How do I include another php file passing information with it, for example I aim to include a php that has a message system that creates a temporary html that error: For example, I want to give include('info.php?page=sem-nome'); back a...
asked by 22.08.2016 / 23:39
1
answer

Query in JPQL for insertion of Data

How can I insert data with JPQL containing values: @Query("insert into user values()") User insertUser(); Data:     username     emailUser     
asked by 16.08.2016 / 17:40
1
answer

How to insert data using query in a for loop?

I'm trying to insert data into the mysql DB, and some data is repeated, and others not so who would command the number of executions would be for , but not executing the query inside the for. I already did some test of echo and the...
asked by 19.06.2016 / 22:49
2
answers

Check the number of people per age

How do you check the total number of people in the 0-5 age group, and if you do not have any children with a certain age, please report 0; select idade, count(*) as qtd from pessoa group by idade order by idade example of the curren...
asked by 17.06.2016 / 21:43
1
answer

Days difference between records and display only the results that 14

I have the following query: SELECT V.CHAPA, F.NOME, V.DATA, DATENAME(dw,V.DATA) AS DIA, MAX(V.SEQUENCIALBATIDA) AS BATIDA FROM ARELBATIDATRANSITOVIEW AS V LEFT JOIN V_DADOSFUNC AS F ON V.CHA...
asked by 19.10.2016 / 23:24
1
answer

PHP How to get a random value like in rand ($ min, $ max) but with a query?

For example, in a browser game I want the user to click on attack to return another user who has + - the same battle power as he. $select = $mysqli->query("select * from data order by rand()"); This way it always returns a random value,...
asked by 06.06.2016 / 04:28
1
answer

Query Query MySQL

I have a small question and difficulty in trying to solve my problem, I have the following query: SELECT 'PcldCliente'.'id', 'PcldCliente'.'nome', 'PcldCliente'.'agencia_id', 'PcldMain'.'id', 'PcldMain'.'cliente_id', 'PcldMain'.'sa...
asked by 14.03.2016 / 14:19