Questions tagged as 'select'

2
answers

Error: android.database.sqlite.SQLiteException: no such column:

I added a column in the Users table, invited is an integer. I need to do a select in the table by filtering this field, and I get the following error: android.database.sqlite.SQLiteException: no such column: invited (code 1):, while compiling...
asked by 28.11.2016 / 21:39
3
answers

How to create a table (empty) from a selection of other tables?

EXAMPLE : I have two tables: table1 : with two columns product_id , product_name ; table2 : With three columns tag_name , product_id , tag_name I would like to create a table3 from a selection of table1 and table2 with...
asked by 09.12.2016 / 13:58
2
answers

Returning only one select at a time multiusers [closed]

I have multiple clients connected to a database. These clients make queries, almost at the same time, causing me a headache, when 2 clients get the same result as a select. How do I know when a table is busy or even lock this table until o...
asked by 01.11.2016 / 19:09
2
answers

Query MySql with PHP

I am making a query in MySql to return the quantity of requests that have not been delivered. To see the ones that have been delivered I do: $result = mysql_query("SELECT operacional FROM 'pedidos' WHERE 'status' = 'ENTREGA REALIZADA'");...
asked by 05.05.2017 / 16:26
2
answers

IF condition between PHP MySQL tables

OPa, I have two tables: forma_pagamento and forma_pagamento_selecionada . I have a while where all forms of payment should be listed, so in this while you must have a IF condition where a new column will return me, in c...
asked by 28.06.2016 / 05:21
2
answers

Query with JOIN in 3 tables

I have the following tables: livroautor id idautor idlivro ------ ------- --------- 1 1 (NULL) 2 2 2 3 3 3 4 4 4 5...
asked by 08.08.2017 / 00:02
3
answers

Repeat LEFT JOIN with other parameters in the same query

I have 2 tables: FATHER: id nome Child: id idpai sexo_filho I wanted to do a SELECT that sums up the amount of children man and women, that's the problem, I can only do with one of the sex: SELECT pai.nome, count(distinct filho.id...
asked by 02.10.2015 / 21:19
1
answer

inner join table on 1 = 1 can be considered a gambiarra?

I have a table of provas and a table of alunos that have no direct relationship, I still have a inscrição aluno table and a escolas table, as follows in the modeling below: Ineedtocreateaselecttobringhowmanystudents...
asked by 02.06.2015 / 15:26
2
answers

SELECT with PDO and variable

How can I do a SELECT in MYSQL with PDO next to it below: $buscarNoticiaTitulo = "noticias.titulo LIKE '%teste%'"; $sqlNoticias = $pdo->prepare('SELECT * FROM noticias WHERE :buscarNoticiaTitulo'); $sqlNoticias->execute(array("buscarNoti...
asked by 25.02.2016 / 19:30
1
answer

Using Case or if

I am a beginner in SQL and am having difficulty using CASE WHEN . I have a table called CRM_PROCESSO , in which there is a column with the Status option, but the answer for this status is numeric, being 1 - Aberto ,...
asked by 12.09.2018 / 14:16