Questions tagged as 'sql'

2
answers

How to insert current date in postgresql?

I need to set in a column in postgresql the current date of the insertion as default value for the field. How can I do this?     
asked by 27.09.2016 / 21:13
2
answers

How to use the IN clause in Lambda?

There was a doubt that I thought would be easy, but the content I found I could not understand. Good is as follows: I have the tables    "Customer" and    "ErrorsProducao_Ciente" where they relate 1 to N, that is, 1 error can af...
asked by 12.09.2016 / 19:43
1
answer

Driver mysql is not found when the application is rotated from a jar

I developed an employee registration system. In this system the persistence of the data is done in a mysql database. When I run the program through the package the system works normally, but when I run an executable jar it does not find the mysq...
asked by 25.11.2016 / 08:59
3
answers

check query in 2 tables at the same time with mysql

I have two tables in my DB (mysql), where: 1st Table: CADASTROS With the following fields: ID, NOME, IDADE, CIDADE 2nd Table: FUNCIONARIO With the following fields: ID, ID_CADASTRO, PROFISSAO, SALARIO Running...
asked by 20.05.2016 / 20:39
1
answer

Enter X number of characters in SQL Server field

Hello, I have two banks BDMCOM1 and BDMCOM1_V3_ALEA, both of which have a table named ProductDrive and the field called CodigoProduct, in the database table BDMCOM1, theProductDocument has 5 digits, in the table of the other bank theProductDocume...
asked by 07.07.2016 / 21:40
2
answers

How to modify the value of the fields of a column?

I have a simple question but I could not find a solution. In the same way I can when I use select to bring an empty column using select a.x,NULL as y,a.z from DADOS a , how can I make a column instead of having only NULL ,...
asked by 12.08.2016 / 01:47
1
answer

SQL count and sum

I have 6 SQL codes and all search the same table, it looks like this: +-----+-----+-----+ | A | B | C | +-----+-----+-----+ | 1 | 1 | 1 | +-----+-----+-----+ | 2 | 1 | 5 | +-----+-----+-----+ | 3 | 2 | 3 | +-----+-----+...
asked by 27.06.2016 / 18:35
2
answers

1005 - Can not create table '' errno: 150

I'm starting my journey in programming and I came across a mistake in creating the MySQL database:    1005 - Can not create table 'mydb.provider' (errno: 150) What will it be? I have already logged into several forums but this same error...
asked by 04.02.2014 / 20:59
1
answer

How to remove duplicate lines while keeping other columns

In the example below, I'm interested in removing duplicates of the rows in columns title and time without worrying about the other columns. In the example below I'm interested in having the query return rows 32, 34 and 36 and al...
asked by 04.11.2016 / 17:26
1
answer

Invert value 0 or 1 in a column

I have a table that has many records and a column called posição . It only receives the value 0 for blocked and 1 for released. Now with a precise change, invert these values, where this has to be 1 and where this 1 has to be 0. H...
asked by 11.04.2015 / 01:14