Questions tagged as 'sql'

1
answer

How to do an update on a table by traversing another table in Mysql? [closed]

I have a schematic according to the picture below: The goal is to update the values of the seller_comission column in the tbl_history table. The tbl_history table already has a few thousand records. The seller's commission is different for...
asked by 11.09.2017 / 14:48
0
answers

Group weekend and holiday values for next business day

Well, I have the following problem, I need to group all balance amounts that fall on Saturday, Sunday, or holiday to the next business day. I have a invoices table with the values of saldo and vencimento , and dim_fered with...
asked by 12.09.2017 / 23:33
0
answers

Failed to update in registry

I'm having the following problem, when I try to change a registration made by my application, it creates a new registry instead of changing. My question is, if when I do the trigger insertion of the sequence , I should change to...
asked by 03.09.2017 / 07:30
1
answer

String problem in oracle

I am making a condition to add a field in the database, that is, it will only add if the condition is equal to 0. The problem is that in my execute immediate statement it says that the word PRIMARY is invalid. This is because it should be in si...
asked by 01.09.2017 / 16:20
1
answer

Problem executing SELECT on a table in phpmyadmin

I have several tables in my database, and until recently, there was no problem in any of them. I was able to quietly manage the whole bank by phpmyadmin. However, suddenly in one of the tables the query SELECT * stopped executing properly in php...
asked by 01.09.2017 / 15:57
1
answer

select two tables using where

I have a table of produtos (id,id_categoria,nome,descricao) and a table of imagens (id, FileName, id_produto) . I need to list product data and a product-related table image by id. $sql = $mysqli->query ("SELECT produtos....
asked by 05.09.2017 / 03:31
1
answer

Relationship 1 - 1

I'm having a bit of trouble drawing my relational database model. The idea follows the following principle: You would have a login system, and for this a table user There would also be 3 types of people who would log in to the prod...
asked by 16.09.2017 / 01:32
2
answers

Problem with SQL execution through FORM

Code php: if($_REQUEST['alterarStatus']){ $alterarStatus = trataaspas($_REQUEST['alterarStatus']);} if($alterarStatus=="aprovado"){ $SQL = "update ps set StatusTransacao='Aprovado' where Referencia = '52'"; }elseif($alterarStatus=="comp...
asked by 16.09.2017 / 16:32
0
answers

How to write a text file by clicking on a DataGridView?

I have a DataGridView and when I click this DataGridView I have to write to a file a select comparing a column of a table to another column of another table and what results from that select is what I have to write to...
asked by 29.08.2017 / 15:56
1
answer

SQL Invalid Identifier Error (INNER JOIN) [duplicate]

Select a list of employees who switched from office to department (% with%), the list should contain the registration and name of the employee, the name of the department and position that worked, and also the start and end date ( job_hist...
asked by 29.08.2017 / 23:34