Posts by Pedro Teles • 414 points
14 posts
-
1
votes1
answer727
viewsA: Generate pdf in java
In the Primefaces documentation : In case you need one or more Columns to be Ignored set Exportable option of column to false. <p:column Exportable="false"> [...] <p:column> So in the…
-
0
votes1
answer948
viewsA: SQL the longest date records of an attribute
You are looking for the biggest overall date, without considering each kanban_card_id. SELECT distinct id, kanban_card_id, created_at FROM kanban_card_journals GROUP BY kanban_card_id HAVING…
mysqlanswered Pedro Teles 414 -
1
votes2
answers272
viewsA: Query in two tables at the same time
As the felipsmartins said: Also, it seems unnecessary to me the existence of the cplivro table. I would move the cplivro.idlivro field to the captl table. - felipsmartins In my view the Book-Chapter…
-
1
votes1
answer290
viewsA: encrypt and determine valid time for php url
Come on MD5 and SHA1 are algorithms of HASH, are not encryption. When you encrypt something, you will probably need to decrypt in the future. Algorithms HASH are one-way and it is not possible to…
-
2
votes1
answer1241
viewsA: How to concatenate variables
You need to initialize the variable @groupby. If she is equal to NULL, concatenation will not work. SET @groupby = ''
sql-serveranswered Pedro Teles 414 -
1
votes1
answer468
viewsA: Select Comparing Periods
I made both appointments separately and then with a LEFT JOIN I put the two together. SELECT T1.PRODUTO, T1.VALORA, T1.TRANSACOESA, T2.VALORB, T2.TRANSACOESB FROM (SELECT ACC.PRODUTODESC PRODUTO,…
-
2
votes1
answer118
viewsA: Retrieve records created in a Mysql date range
SELECT * FROM EFETIVO_POSTO WHERE COD = $chave AND INICIO <= CURDATE() AND FINAL IS NULL --retorna os efetivos que AINDA estão sendo executados I imagine that if it has not yet been completed,…
-
0
votes5
answers1137
viewsA: Postgresql - Remove tuple referenced by another table
If the rows of the daughter tables you’re checking aren’t important, I mean, if you just need to consult the existence of daughters referencing the parent you’re trying to exclude, you can use…
-
2
votes1
answer197
viewsA: How to add unpaid installments with SQL?
Greetings! SELECT par.id_pa as Parcela, par.valor_parcela, valor_pago FROM parcelas AS par LEFT JOIN (SELECT id_parcela, SUM(valor_bruto) as valor_pago FROM pagamentos GROUP BY id_parcela) as pgtos…
-
0
votes2
answers54
viewsA: Display user messages
When user 6 exchanges messages, he may be in the position of sender or receiver, then we need to make a consultation that contemplates the two situations: SELECT sender FROM chat WHERE receiver = 6…
-
2
votes3
answers1803
viewsA: Tables/Temporary content in the database?
How you generate tables and data that are temporary, use temporary tables. In SQL Server CREATE TABLE #tabela_local( id int, descricao varchar(50))<br/> CREATE TABLE ##tabela_global( id int,…
-
3
votes1
answer635
viewsA: Select with Join in Codeigniter
Lacked a Join, follows the code: $this->db->select('jogo.*, t1.time AS time_nome1, t2.time AS time_nome2'); $this->db->from('jogo'); $this->db->join('time as t1', 't1.id =…
-
2
votes1
answer1233
viewsA: Left Outer Join does not bring Null values
Dude is hard to understand your problem, maybe you could improve the description of your tables and data. If I understand correctly, you are not seeing some data because of the 'Where' clause. You…
-
3
votes1
answer49
viewsA: Mysql table alias or clone
The best solution would be to create a second table with identical structure to the first one and work with Rigger. Whenever there is insertion, update or deletion in Table 1, it will update in…
mysqlanswered Pedro Teles 414