I am creating a query and my pull request returned because the code tester considered that OR is not good for table relationships.
Example:
FROM LEFT JOIN administracao.cidade cid
ON (cid.cid_cd_cidade = cec.cec_c...
I can not perform the percentage of this query.
You should take the sum of the "value_convenio" of each municipality and divide by the sum total of the "value_convenio" :
<h3>Entrada SQL SEM CALCULO DE PORCENTAGEM</h3>
SELECT...
I need to make a select in sql server 2014 to the result of a subquery, example:
select * from tabela2 where codigo like ("1;3;4","3","1;2;5")
Where ( "1;3;4","3","1;2;5" ) is the result of the subquery ( sele...
How do I perform an update at the same time on two different tables?
I have a table named Tarefa and another called VinculoReferencia , both have the field Taridinclusao where is this field that needs to be updated at th...
I have a javascript function that gets the value of the selected item in a combobox, and would like to pass that value as a parameter to a SQL query to bring the data that are related to the value obtained in the selected combobox in my asp page...
I have a JOB configured in SQL to run every 30 minutes, it has 2 steps, 1 procedure in each step, but when the first step reaches 1 minute of execution, it quits without executing all the registers it should and starts the second step.
How do...
I would like to add up the total sales in the month, but not repeat the year.
select EXTRACT(year FROM v.dataVenda),
case when EXTRACT(MONTH FROM v.dataVenda) =1 then sum(v.valorvenda) else 0 end as Jan,
case when EXTRACT(MONTH FROM v.dataVend...
I need to implement a working hours report within a period.
My difficulty is this: the records for each day are on different lines and because of this, I'm having a hard time knocking in and out of the right days and I still have to subtract...
How can I collect only the first and last mark, where an official can have X Markings and even markings the next day?
As the example below
+------+--------+-------+-------+
| FUNC | DATA |ENTRADA| SAIDA |
+------+--------+-------+-------+...
I have a SELECT and in it I display the sum of the sales values of each product, would I have to make a total sum of the table that made the sum?
SELECT
cadpro.descricao,
sum(itensped.total_venda) AS total_venda
FROM itenspe...