Questions tagged as 'sql'

2
answers

Problem with sorting by date with DATABASE plugin

I have a problem with the ordering of a table with a Datatable plugin and I am doing a SQL query already ordered by a field and when I present the table with the plugin it reorders it in another way and I tried several ways without success ....
asked by 20.03.2018 / 15:48
1
answer

Execute trigger according to the value of a column

I need this trigger to be executed when there is an update in the auction table, but only when the value of the auc_status column is equal to 3 . That is, as soon as the value of auc_status is changed to 3 , it must exe...
asked by 20.03.2018 / 18:54
0
answers

How to calculate the next available house?

At the moment I'm doing a project and I'm having a problem with an algorithm. Given the 4 directions (North, East, South, West), if the user chooses one of the 4, the next available home with 1 empty house should be allocated. The house...
asked by 23.03.2018 / 17:49
1
answer

Doubts in HQL while doing Sum function

I have a question in hql. My system has 3 tables table1 and table 2 and table 3 table 3 stores the primary key records of table1 and table2 to make relationships. Table 1 can contain N associations with table 2 but table 2 can only belo...
asked by 15.03.2018 / 19:25
0
answers

Error 1215 MySql

First of all, I would like to say that I have checked several questions about this here and no solution worked. I'm giving alter table in the official table to add two foreign keys ... one of them works (num_department) but the other one fo...
asked by 17.03.2018 / 19:25
1
answer

Add two columns created

I need to add two columns created according to a date and grouping them by another column. I need to create a new column called the previous balance that adds ( VALORDEBITO + VALORCREDITO ) and groups by CONTADEBITO and CONTAC...
asked by 17.03.2018 / 21:10
0
answers

Oracle - Lock that prevents SELECT

Lock that prevents SELECT The situation is as follows: An ERP application (Totvs) with several tables All these tables use as primary key a default field R_E_C_N_O_ The application (I believe) creates a new record common select max (R_E...
asked by 13.03.2018 / 21:16
0
answers

Select data from 2 PHP tables

Good people, I have here two tables with the following structure: 1 - Orders, 2 - Order_items. I need to select the data of each and display the details of the purchase, for example: Home Order # 1 (table 1) Client: Thales (table 1)...
asked by 15.03.2018 / 18:42
0
answers

SQL script to fit decimal point of a column - PostgreSQL

I have a table in PostgreSQL that has the field IdProduto and Quantidade . The Quantidade column values were written to the wrong decimal places. Ex: 9000,000 was written when it should be 9,000 . The lack of...
asked by 15.03.2018 / 14:41
1
answer

Help in Sql that queries 2 fields from the same table

I have the following problem to solve: I need to make a Sql that queries an X table "Tabela X": id coluna1 coluna2 "Tabela 2": id coluna1 coluna2 coluna3. In "Table X" column1 and column2 are foreign keys of "table 2" both with differe...
asked by 15.03.2018 / 14:57