Good morning
Could you instruct me to change the order of the columns in a table?
Example:
I have Table IcmsMvaUF in the following order:
I'd like to pass the MvaEmpresa column to the first column on the left side of the...
code is PK in both
tabela1: cliente
codigo, nome, municipio
tabela2: notafiscal
codigo, numerodanota, cod_cliente
I want to list a count (*) on all notafiscal where cod_client.municipality = 10
How do I run this sql?
I have an array that will be variable, eg $ ref = array ('123', '654', '555').
I wanted to do a SQL query to bring information from these references, something like:
SELECT *
FROM tabela_itens
WHERE ref = (array do PHP)
How can I do th...
I need to display this:
So:
Following the link's instructions:
Using the PIVOT operator without aggregation
I can not place a subquery inside the IN in PIVOT
Dynamic Pivot with SQL Server
I came to this script:
create t...
As far as I know, creating a constraint (such as a foreign key or a check) as DEFERRED causes it to only be validated at the end of the transaction.
Why is this used? And when should it not be used?
I would like to know how to write a SQL for control purposes of the statement being sent to the database:
$sql = $pdo->query("SELECT * FROM imovel WEHRE CATEGORIA = 'APARTAMENTO'");
How to print the SQL statement being sent to the bank?...
In MySQL, when we are going to make a SELECT , we can usually specify each field we want to return.
SELECT id, nome FROM usuarios
However, let's imagine a scenario where I have 50 columns in a table and I did not want the senha...
For example you have in the table the values: green, red, blue, blue, pink, pink, pink, yellow. I would need to return from the table colors only once blue and pink. Do you have any way to do this?
I have the following table:
Nome | Posicao
Item1 | NULL
Item2 | NULL
Item3 | NULL
I would like it to look like this:
Nome | Posicao
Item1 | 1
Item2 | 2
Item3 | 3
Sorting criteria is Name