Questions tagged as 'sql'

1
answer

How to do this sql

I have the following table: table http://i62.tinypic.com/35mjjhz.jpg I use a command SELECT , type: SELECT estudante, conceito_1, conceito_2 FROM estudante WHERE etapa = '1ª' How could I make a single select to get the 2nd and...
asked by 15.08.2015 / 16:39
1
answer

XML for temporary table records

Last week I I asked Here about how put each XML tag in a column of the database. Now I came across a situation next to it but with a plus, my XML comes from the database, and sometimes it will not come just 1 record, but more than one. In t...
asked by 15.10.2015 / 20:52
1
answer

Sql - postgres - Arbitrary precision :: numeric

How does arbitrary precision work by setting the column to numeric ?     
asked by 19.10.2015 / 22:04
1
answer

Query not identifying value

SQL command: SELECT message, count(message) as amount FROM 'messages' WHERE LENGTH(message) >= 4 AND amount < 30 AND message != '#ddd' AND message != 'ddd' GROUP BY message ORDER BY amount DESC LIMIT 3 # 1054 - Unknown column 'amoun...
asked by 08.03.2015 / 17:28
1
answer

Duplicate data

I have a table where the clients create the budget and each product inserted a registration is made to separate, but I want to make a query by the name of the client that the system does not take more than one, but one. thanks in advance     
asked by 04.03.2015 / 20:10
1
answer

Maximum and minimum payment

I have two tables, customers and payments , I want to check for each client which was the highest and lowest payment that each one made. I did this SQL, but it did not work, could anyone help me? SELECT c.customerName, max(p.amoun...
asked by 20.10.2015 / 18:06
1
answer

UPDATE, field with placeholder query failed to execute

Follow the code: $campo = $_POST['campo']; $valor = $_POST['valor']; $id = $_POST['id']; $mysqli = new mysqli("localhost","root","","tabela"); mysqli_set_charset($mysqli,"utf8"); $consulta = $mysqli -&g...
asked by 20.01.2015 / 01:38
1
answer

How to get the record total from a table

I need to know how many records there are inside my table and add the total found in a variable. I'm doing the following but it does not work: <?php $w_querybusca = "SELECT * FROM Elem_matr;"; $w_queryresultado=f_class_co...
asked by 26.11.2014 / 14:01
3
answers

Search by selection field

I'm creating some filters to search for products, having the products all visible, I would like to know how I can make a selection field and through the category that the user chooses, only the products of that category would appear. I have the...
asked by 19.01.2015 / 16:33
2
answers

Search for MySQL data list

Currently on my system, I'm calling each column at once: $sql2 = mysqli_query($db, "SELECT group_id FROM login WHERE userid = '$userid'"); $exibe2 = mysqli_fetch_assoc($sql2); $_SESSION['group_id']=$exibe2['group_id']; And in the file I'm c...
asked by 21.03.2015 / 18:07