Questions tagged as 'sql'

1
answer

Mysql UPDATE with JOIN and WHERE [closed]

My tables EMPREGADO Cod_Emp, Nome_Emp COMPANHIA Cod_Comp, Nome_Comp TRABALHA Cod_Emp, Cod_Comp, Salário, Cod_Emp_Supervisor I want to give a 10% increase to all test company supervisors. UPDATE trabalha INNER JOIN companhia ON tra...
asked by 29.09.2016 / 02:08
2
answers

How to search in one table by date and add values contained in it?

This is personal, I'm having a hard time creating a date search in my android sqlite database. I wanted to search the tables by date, if possible, I wanted to do a conditional that would detect the current date, and only update the table (adding...
asked by 23.04.2016 / 19:21
1
answer

Doubt to use the combobox

Good morning, I have a final work of the web development chair, where I need to create a crud for teams, players, create a Brazilian championship style table and create the rounds. I already managed to create the cruds and the table of the ch...
asked by 09.06.2016 / 14:18
1
answer

Problems getting ResultSet value

I'm trying to get the values from a select in the derby but they only correctly return a field from the ResulteSet. Here is the code for the DB access class: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet;...
asked by 09.06.2016 / 15:17
1
answer

How to convert certain group of columns to JSON?

I have the following problem: I have a table with N columns, but I would like to make almost all of them into a single column of type json, eg: id, json(col2,col3,col4) as dados I looked at the documentation, and found a command that...
asked by 26.03.2016 / 01:45
2
answers

How to use special order_by of mysql in codeigniter

In mysql I can do this. SELECT * FROM 'Cidade' ORDER BY 'id'=1347 DESC But I can not do codeigniter, I'm trying like this: $this->db->order_by("id = 1347", "DESC") ->get("Cidades"); In this case his output look...
asked by 29.03.2016 / 15:45
1
answer

How to use a table in the bank with different fields of the model layer?

For example, I have a table where the field in the database named COD_CLIENTE , but in the model layer it is ID_CLIENTE , how to access that value without changing the name of the model in VB.net ? Partial Public Class Cadast...
asked by 28.03.2016 / 22:05
2
answers

Select from all companies that have catalogs

I'm having a problem with a select in two tables that are returning the value twice. I have the companies table and table catalogs that are linked by company.id and catalogs.id_enterprise . When I make a select that has two...
asked by 18.05.2016 / 15:29
1
answer

Automatic Database Synchronization in MySQL

Hello, I have a local MySQL database where the availability is 24h, however I have another database in another place that is available for a few hours, anyway ... I want to synchronize two identical databases automatically when both are availabl...
asked by 21.03.2016 / 14:24
3
answers

Difference between dates in several lines

Is there any way to do a DATEDIFF / LEAD / LAG in SQL Server to calculate the difference between dates taking into account the previous / next record date. SELECT SELECT NUM, CLIENTE, EMISSAO FROM PEDIDOS WHERE CLIENTE = '06.028' ORDE...
asked by 02.03.2016 / 19:20