Questions tagged as 'sql'

2
answers

how to select only 1 record of each id

After doing an inner join between the user (1) and image (N) tables, the following table is returned (the id refers to the user id and the file_name to the image file): | id | filename | 12 | img1.png | 12 | img2.png | 13 | img3.png...
asked by 06.11.2015 / 18:24
1
answer

Search by dates

I have a screen and on this screen I have a TextField that is populated by a date in the format dd/mm/yyyy and then I convert that date to yyyy-mm-dd which is the format of java.sql.date until there is quiet, but now I am no...
asked by 29.05.2015 / 21:12
2
answers

How to round up age with PostgreSQL?

I used the age() function, below, to calculate the age, from a date stored in a table: select pessoa.*, age(data_nascimento) from pessoa; Returned the range: 27 years 9 months 9 days Is it possible to round this range to only 27...
asked by 17.06.2015 / 03:07
1
answer

How to do a string concatenation with values from a database?

I want to concatenate different record values, for example, I have the table below: | id | value | 1 | value1 | | 2 | value2 | | 3 | value3 | To show the following result: value1, value2, value3 I'm using PHP + MySQL.     
asked by 10.10.2015 / 05:21
3
answers

Save a great form in the database

Let's suppose I have a large form, 30 fields containing textareas , radio buttons , checkboxes , select tags , etc. After the submit of the form, what would be the best way to get these values and then save them...
asked by 16.10.2015 / 22:04
2
answers

1054 - Unknow colunm in on clause

What is wrong with this query? SELECT clientes.idClientes, clientes.nome, clientes.bloqueado, planosclientes.idPlanos, planos.nome, enderecos.bairro, enderecos.cidade FROM planoscliente...
asked by 05.10.2015 / 14:39
1
answer

Displaying Results other than one column [closed]

I have a CAIXA table, where TIPO can have two results, 00 and 99 , where 00 is the opening of the terminal and 99 the closing. > I'm trying to create a query where the result is to show me only the bran...
asked by 27.08.2016 / 15:58
1
answer

Error opening SqlConnection

This is the following I have a gridviewer that is connected to a Query with a  Table named Server Table. When I want to add some things to the columns it gives the following error    Instance failure. In this part of the code connectio...
asked by 24.08.2016 / 16:42
1
answer

Is it advisable to have a table of Users relating to others?

I am a beginner in systems development, and I wonder if the system user table could establish relationships with other tables, such as the company table.     
asked by 02.04.2015 / 17:50
1
answer

Replace in Date within a FOR

I want to return the last 12 months, the day should come as 01 and need month and year. ex: 2014-12-01 2014-11-01 NOTE: I placed yyyy-mm-dd only by a pattern of mine. I'm doing this: DECLARE @count INT DECLARE @Data_Atual DATE SET @cou...
asked by 08.01.2015 / 19:05