Questions tagged as 'query'

4
answers

Help with distinct

I have the following sql query: select nome, data, situacao from cadastro The result is like this: MARIA 01/01/2018 0 MARIA 15/01/2018 1 GISELE 15/01/2018 0 CICERA 08/01/2018 1 ANTONIA 20/01/2018 0 ANTONIA 15/01/2018 1...
asked by 29.01.2018 / 14:12
1
answer

Query to join specific tables

I need to join 3 different tables. But the result I want is: When the reference exists it should join, when it does not exist it should show blank or NULL. My structure: Contact table +------+------------+ | ID | Nome | +------...
asked by 25.07.2016 / 20:12
3
answers

Is it possible to perform update on 1 table using another condition?

I have the following query: update ivr_contatos,ivr_campanha set ivr_contatos.tentativas = 0 where ivr_contatos.status = 0 and ivr_contatos.tentativas >= ivr_campanha.qtdtentativas The question is, if I can update in the field tries ivr_...
asked by 18.05.2018 / 14:20
1
answer

Named database column with alias not found in WHERE clause

I have this SQL query where I need to name the same column datareferencia to anobase and mesbase , as follows. But column error is not found. In my view, after I apply the alias the column happens to exist, but it seems that...
asked by 05.01.2017 / 03:04
2
answers

Persistent error in C # database

I was doing a project but there was a problem involving OleDbCommand occurring in two different places: dr_alu = _dataCommand.ExecuteReader(); if (dr_alu.HasRows == true) dr_reg_notas = _dataCommand.ExecuteReader();...
asked by 11.08.2017 / 02:15
2
answers

Error inserting Data in Mysql

I have this query to insert a data into the database: INSERT INTO 'bancoTeste'.'TabelaTeste' ('t_id','t_label', 't_parametro', 't_valor', 't_descricao', 't_valores_padrao', 't_tipo') VALUES ('NULL','Cargas', 'monitorar_carga','N', 'apresentar...
asked by 29.11.2017 / 14:04
1
answer

Sql Query, fetch data from given id [closed]

How to make a query, searching for data from the given ID? For example, my table has 1mil records, I want to determine in a foreach the search of the data from the 300 record.     
asked by 24.01.2017 / 22:37
2
answers

How do I search for a string in a table on Android?

I want to search using the "clas" field, which is a String. And listSearch receives a String. public Cursor listPesquisar(String pesquisa) { Cursor cursor; String[] fields = new String[]{"_id", "nome", "peso", "altura", "ce...
asked by 13.06.2017 / 21:16
3
answers

How to make more than one select in the same query in different DB tables?

The problem is as follows: I have the tables: Whatareforeignkeysinthefollowingtable: AndIneedtopullallthenamesofthe"connector_model", "connector_name" and "connector_type" columns and concatenate and echo an individual search. To do th...
asked by 06.03.2017 / 19:07
3
answers

How to View SQL Query in an Array

I have a question. When I run a Select Count in the database it displays everything right. But how to display the same way using PHP? select country, count(*) as quantidade from customer group by country $sql=mysql_query("select country, co...
asked by 30.04.2015 / 01:33