Questions tagged as 'query'

2
answers

Can you use the same query and set two different "ORDER BY"?

I use the following excerpt for one queried to the database $cs1 = $pdo->query("SELECT TITULO, URL, IMAGEM , TEMPO FROM post ORDER BY CLIQUES DESC LIMIT 5")->fetchAll(); I would then like to explore this query further in order to use...
asked by 08.12.2014 / 00:05
4
answers

Is there any way to show the result of a query (mysqli) in the form of HTML?

I have already looked intensively for a solution to show the result of a mysqli query within an html, but I can not find anything. I saw that it is possible to present the result through one with the help of fetch_assoc () in php, but what I wan...
asked by 26.08.2015 / 23:58
1
answer

Query works in database but not via code

using (var cnx = new OleDbConnection(new AdministradorDAO().conexao)) { var sql = @"insert into usuarios(matricula, nome, senha, nivel, maleta, email) values (@matricula, @nome, @senha, @nivel,...
asked by 16.09.2014 / 22:42
1
answer

How can I insert the results of a query into another table?

I'm running the following query directly from the phpMyAdmin : SELECT shop.id AS cart_details_id, shop.id AS cart_id, e.name AS client_name, e.nif AS client_tin, e.addr AS client_address, CONCAT (e.zipcode, ' ', e.zipcodeext) A...
asked by 24.12.2013 / 18:27
2
answers

SQL Query - put result on a row only

SELECT pga.Titulo, e.Codigo FROM Qualidade_Diagrama_Processo_Grupo_Acao pga JOIN Qualidade_Diagrama_Acao_Entidade ae on (ae.Id_Proc_Grupo_Acao = pga.Id) JOIN Qualidade_Diagrama_Entidade e on (e.Id = ae.Id_Entidade) WHERE ae.Id_Pro...
asked by 04.07.2018 / 14:38
2
answers

How to extract in a string the date-time of a given XML field - SQL Server 2012 Query

Good afternoon! Personal, in my table log has a field called logdescricao and in this field it stores several expressions. For example: <log expressao="7085"><par traduzir="N">André Mariano da Silva</par><par traduzir="...
asked by 05.09.2017 / 19:38
1
answer

Query - Comparison of distinct bases with equal columns

How would a query make the selection between two tables according to the value of a specific column? For example: I have two tables that contain account number and Balance, I need to know which accounts are not with the same balance. Tab1...
asked by 30.04.2018 / 21:08
1
answer

Pick up only the days of the current month

I have the query below where it is done on the current day, how could I make the same query in the current month until today, example: 01/09 13/09 but so that the query tomorrow is: 01/09 to 14/09 and so on. SELECT o.numero...
asked by 13.09.2016 / 23:49
1
answer

Update in a table with values from another

How to update the values of a table, using values taken from another table: UPDATE produto -- atualizar a tabela produto SET produto.quant = SUM(entrada.quant) -- produto.quant será igual a soma da coluna quant da tabela entrada WHERE pr...
asked by 16.03.2017 / 14:51
2
answers

Error "Undefined variable"

I'm trying to run this code but it's not working. $sql = "SELECT * FROM cliente WHERE id = $id "; $limite = mysql_query("$sql"); while ($sql = mysql_fetch_array($limite)){ $nome = $sql["nome"]; $telefone = $sql["telefone"]...
asked by 27.02.2015 / 08:00