Questions tagged as 'select'

2
answers

Get the number of dependents of an employee

I'm trying to do a search between 3 tables: Employee, Dependents, Employee_Dependent; I want to do the research where I show the number of dependents of each employee. I did the following: select dependente.*,funcionarios.* from fu...
asked by 02.05.2015 / 20:54
2
answers

Validate the return of select PHP

I am making a select and before printing the form on the screen I would like to validate if the select returned lines, as I do this I tried in several ways without success. $stmt = $dbh->prepare($fat_ped_online_vende); $stmt->execute();...
asked by 20.01.2017 / 18:17
3
answers

SELECT in two tables, with comma-separated IDs

Hello! How to do a SELECT that returns the data of the first table, whose "id" are separated by commas in the second table? Example: tbl_cores id | cor 1 | azul 2 | verde 3 | amarelo 4 | vermelho tbl_mesa id | core...
asked by 13.06.2016 / 14:07
2
answers

Consultation and simultaneous change

Considering a table similar to this: Tabela : [Frutas] ╔════════╦═════════╦═════════╗ ║ Fruta ║ Cor ║ Mordida ║ ╠════════╬═════════╬═════════╣ ║ Maçã ║ Verde ║ Não ║ ╠════════╬═════════╬═════════╣ ║ Banana ║ Amarela ║ Não ║ ╠═...
asked by 16.04.2018 / 18:06
2
answers

How to mount a SELECT with nonexistent numeric column ordered

I want to do a SELECT with some columns already in the database and add a ordered numeric column starting at 1 for each row (I do not want the ID). I'm using PostgreSQL 8.4. Example: SELECT descricao_produto, preco, coluna...
asked by 28.01.2016 / 21:17
3
answers

Select value other than "X" name

How do I select only the different ratings of "X" in a given column? I created the select below: SELECT top 1000* FROM [tabela_clientes] WITH (NOLOCK) WHERE STATUS= 'pendente' and status_2= 'pagamento' and REGIAO= 'sao paulo' --------...
asked by 04.06.2018 / 22:28
3
answers

How to perform a select by multiple fk?

I have a question about one (or more) select . I have the following bank set up and I need to do a search for a particular recipe based on one (or more, and oh, that's the problem) ingredients. How do I get the recipe that contains all the...
asked by 23.03.2018 / 04:55
3
answers

Is there a way to start a Select (SQL) in the middle of the data table?

Is there any way in the SQL language (and using BD mysql) where I can start a Select in the middle of a table? For example, I have 500 addresses in the table. I search the addresses of Bairro X (where neighborhood="x"), reducing the total to,...
asked by 19.12.2017 / 16:35
2
answers

Enable select HTML with

I have a table, where fields start disabled, and in a checkbox I choose which field to enable. Tagged input , works perfectly. But when I try to use with select the same script does not work. I tried to add this method only to...
asked by 23.02.2015 / 13:10
1
answer

Multiple results in a single record - Oracle

I have the following situation: I have a select where it returns me that the patient TEST passed in the clinic ABC, and performed procedure 01 and 02, but in the result of query it returns me thus < strong> bold text : Patient | Clin...
asked by 31.07.2017 / 18:31