Questions tagged as 'sql'

2
answers

SQL query only for non-null records

I have a NotasFiscais table and am fetching all the records it contains in the NChave column. However some results contain this information and others do not, in this case they are NULL . How could I bring only 'true' records...
asked by 18.04.2017 / 22:02
2
answers

Update two tables with condition

I have the following scenario Two Tables Source Table - Destination Table Both with the same fields [ID] [Name] [CPF] The query must go to the [CPF] columns of the two tables, when the [CPF] of Source and Destination are the same, you must...
asked by 16.05.2017 / 19:28
2
answers

Add a number in front of all records

A question arose when assembling an sql statement. I have several records in a table called db_contrato , I wanted to add the number 0 in front of all the records, for now I defined the contract column as varchar (50). db_contract id|...
asked by 16.01.2018 / 13:56
2
answers

Doubt with sql command in C #

SqlCommand comm = new SqlCommand("UPDATE Contatos Set Telefone=" + " ' " + txtTelefone.Text + " ' " + ",Cidade=" + " ' " + txtCidade.Text + " ' " + ",Email=" + " ' " + txtEmail.Text + " ' " + ",Endereco=" + " ' " + txtEndereco.Text + " ' " + "WHE...
asked by 26.11.2015 / 17:29
3
answers

How to recover user session

I wanted to just retrieve a user's session. I have a class called SystemUser , which identifies which user is logging on. In this class, I get the session and play for an object. @ManagedBean(name = "usuarioLogado") @SessionScoped public clas...
asked by 26.10.2015 / 02:08
2
answers

Get ID of a line that was just created in PHP

Hey guys, So I have a problem that is as follows, I have a table players , a table training and a helper table treadmill (where will I see if some player is currently training) The question is, how can I do that by the time I create a worko...
asked by 10.11.2015 / 19:44
3
answers

multiple values for a column in Where

Is there any way to put multiple values for a column in WHERE ? For example product A has been replaced by product B, product 2933 by 4044, the product 2599 by the 7845, and the product 5987 by 9432. Example: where DepartureDate...
asked by 20.06.2017 / 19:35
2
answers

Help with select and repeated records

I have a postgresql database with a table like this: id_usuario | dt_atualizacao | atualizacao | outros_dados 123 | 01-01-2001 | 0 | abc 123 | 01-01-2005 | 1 | abe 123 | 01-01-2012 | 1...
asked by 28.08.2018 / 18:50
1
answer

How do I change MySQL database insertion order?

I want to insert something into my MySQL (PhpMyAdmin) it inserts and above the last post. Example: Yesterday I inserted Nome: Pedro | Idade: 20 Anos and it was at the top because it was the first one to be inserted into the database...
asked by 27.10.2018 / 15:11
3
answers

Problem in the order of select

I fed this chart ButIhaveaprobleminselectingit<?php$sql_2_vis=mysqli_query($config,"SELECT data, uniques, pageviews FROM tb_visitas ORDER BY id DESC LIMIT 7") or die(mysqli_error($config)); if(@mysqli_num_rows($sql_2_vis) <= '0'){...
asked by 11.05.2018 / 14:02