Posts by MarceloBambino • 151 points
9 posts
-
0
votes1
answer153
viewsA: Group SQL results by date
To group by date and add the columns seg_online, aj_sent and lvl_upado just do the following: select from_unixtime(ts_sessao, '%d/%m/%Y') data, sum(seg_online) seg_online, sum(aj_enviadas)…
-
2
votes2
answers254
viewsA: Mysql doubt compare multiple columns
Here is a solution that addresses your problem. The logic was simple: 1- Return employees who have not hit the target on one or more requirements. select f.nome, c.requisito, c.valor…
-
2
votes2
answers321
viewsA: How to give a select and bring the top 1 of each group?
Hello, You need the last execution of each process, right? Below is a query that solves this scenario. select distinct nome_processo, (select max(data) from processos p2 where p1.nome_processo =…
-
0
votes2
answers517
viewsA: Selection top 3 Where distinct
Good night, Well, now with the new information , follows adaptation that I made of my first suggestion with the new scenario that you passed (OBS: I could not test the commands, but I will explain…
-
0
votes1
answer142
viewsA: Cumulative count per month
Opa, I have a suggestion to try to solve your problem, but I’m not familiar with the syntax of Mysql (I googled the right functions, but I couldn’t test them). I will write the code below , explain…
-
2
votes1
answer47
viewsA: I cannot compile my program because I have an error that says "Nullpointerexception"
If you’re making a mistake NullPointer in the method ligar and this is in the class Motor, most likely is that you did not create an object of Motor. In your class Carro has a variable of type…
-
2
votes4
answers126
viewsA: Can I put a WHERE for each column?
You are counting twice the same column (id_casa) and calling one from casaAzul and another from casaAmarela. What you should do is group the houses by color and give a Count on it. Mysql moved very…
-
1
votes3
answers121
viewsA: MAX() returning multiple lines
Hello, As colleagues mentioned above, it is correct to return the three values. The easiest way to get around this, assuming you already have the select ready, is to put it in the from in the form…
-
0
votes3
answers83
viewsA: How to consult register that does not contain a certain code?
Hello, I think the code below solves your problem because it takes all the calls that do not exist an action 140 associated in table tb_acoes. select chamados from tb_chamados ch where not exists…