Questions tagged as 'select'

2
answers

How to check Null in a select @Local_Variavel

How to set a default value for a local variable, if the select that should "set" it returns NULL ? For example: DECLARE @Minha_Var VARCHAR(70) SELECT @Minha_Var = Nome FROM CLIENTES WHERE Id = 10 This query can return NULL , ri...
asked by 25.10.2017 / 12:06
2
answers

Using & in Oracle search

I have a question about the use of & in Oracle. See below my table. Whenreferringtothedescription'EasyBreezyEmailmkt&I',Oracleopensawindowforparameterpassing,asshownbelow. My question, how can I query with & without the b...
asked by 19.07.2017 / 20:38
1
answer

Select with LIKE with argument%

I'm trying to make a select, using LIKE and setting the argument%:    WHERE title LIKE '% computer%' finds all book titles with the word 'computer' anywhere in the book title. source: link However, when I run the direct comman...
asked by 14.08.2016 / 16:02
2
answers

Select to subtract current value from previous and return column with result

I have two tables: Samples and Values, which have columns as follows: TABLE Samples Amostra_id Data Operador_Id Carta_Id TABLE Values Amostra_Id Valor As you can see, the Values table relates to the Samples table from Sample_...
asked by 14.08.2014 / 03:15
2
answers

Error in SQL result

Well, this is what I'm doing, I'm having to do a select in a database, where I should look for values that exist between two dates, and that have a specific user. I made the select like this: SELECT * FROM 'tabela' WHERE 'data' BETWEEN 'dataIn...
asked by 31.05.2017 / 21:01
1
answer

Count equal dates select MySql

Hello, in a MySql database I have a table like this: email | data_envio a |2016-10-01 05:32:57 b |2016-10-02 09:36:56 c |2016-10-02 08:16:52 d |2016-10-03 10:36:51 e |2016-10-04 10:36:51 How do I make a sel...
asked by 17.11.2016 / 17:22
2
answers

How to do a replace into from one server to another?

I have the table below on 2 servers and I need server 1 to send all this information to server 2 ie the id, username, iddns, dns, ipdnstipo e ipdns fields as it is. Table CREATE TABLE IF NOT EXISTS 'trad' ( 'id' int(11) NOT NULL,...
asked by 05.09.2014 / 21:48
1
answer

Select a Mysql table inside a PHP file without refresh

Select Mysql database data inside a PHP file without refresh. Example: <?php // Essa select abaixo tem que buscar a cada 5 segundos sem atualizar a página $selecionaTabela = mysql_query("SELECT * FROM nomeTabela")or die(mysql_error()); /...
asked by 10.06.2014 / 16:07
4
answers

Doubt with month and year extraction in PostgreSql data

I'm using a select command where I get the month and date year as follows: extract(year from D.dt_ficha) + extract(month from D.dt_ficha) But instead of appearing like this: 201711 November 2017, it is adding 2017 + 11 202...
asked by 09.11.2017 / 15:33
2
answers

How to get records for the last 15 days - PostgreSQL

I have a table called Entrega where all the deliveries made with their respective dates are stored, how can I only deliver deliveries from the last 15 days? Doing so I can deliver from 10 October, for example: SELECT * FROM public.entre...
asked by 13.10.2017 / 16:46