Posts by gugoan • 87 points
5 posts
-
0
votes1
answer47
viewsQ: Turn specific rows into columns
I have a table of activity histories and would like to turn some rows (of some specific status) into columns: Current Table: The statuses I wish to turn into columns are these: mod_analise_status_id…
-
0
votes1
answer58
viewsQ: Difficulty in using LAG to catch the percentage of monthly evolution
I have the following table below and would like to catch the monthly evolution (%) of the total transactions per month. I researched the LAG function but could not understand very well. I need the…
-
0
votes1
answer746
viewsQ: Date Comparison (status due)
I have an informed date ($date_crl) and need to show an alert in 3 conditions: If date_crl is greater than 30 days from current date: VIGENTE. If date_crl is less than the current date: DUE. If…
-
1
votes2
answers1179
viewsA: Mysql - Recursive query to get only parent categories
Thanks guys, the SQL below solved my problem: SELECT y.desc_category as segment, sum( x.value) as total FROM ( SELECT category.id_category, category.desc_category, category.parent_id , c.value AS…
-
1
votes2
answers1179
viewsQ: Mysql - Recursive query to get only parent categories
i have the following table category: id | desc_cat | parent_id 19 | Pessoais | (null) 20 | Cartao Credito | 19 21 | Academia | 19 22 | Residencia | (null) 23 | Agua | 22 24 | Luz | 22 25 | Aluguel |…