Questions tagged as 'select'

1
answer

Query 2 tables in a sql database and display repeated values [closed]

I have 2 tables in my database, one call pessoas and another call resultado , I am filling the result table with the draws made by mega sena, the result table has the fields: data, dez1, dez2, dez3, dez4, dez5, dez6 The people...
asked by 10.10.2017 / 05:23
1
answer

I need an item from my select to be selected, Angular

I have a select component <div class="form-group col-md-4"> <label>Entidade:</label> <select ng-model="distrito.entidade.idEntidade" class="form-control"> <option value="{{dis.entidade.idEntidade...
asked by 02.10.2017 / 20:53
2
answers

Group [group by] SQL Firebird

I would like to know if there's any way I can do a query where I can bring fields that are not in my group by . I have the following code: select sum(TAB_FATURAMENTO.vl_item),CLIENTE.insc_cnpj from TAB_FATURAMENTO inner join (IMP_PROC...
asked by 07.08.2017 / 17:09
1
answer

Count in multiple tables

I have 3 tables Ineedaquerythattakesthenameoftheschool,amountofclassestypeA,qtdeofclassestypeB,qtdeofstudentswhoareinclassestypeA,andqtdeofstudentswhoareinclassestypeB.>Sameasthisexample: I tried to do Select E.NOME, SUM(CASE WHEN C...
asked by 14.08.2017 / 19:03
1
answer

PHP - MODAL window

I have tried some scripts but I have not tried it, I apologize if it has already been in a forum, but I looked for modal and nothing suited my need, I have a modal inside the button Client, which upon clicking loads a table with data coming fr...
asked by 14.09.2017 / 15:20
2
answers

How to select data for the month and previous year?

I'm trying to do a search from dates in MySql. I need to get the total sum of a value where the year and month are smaller than the ones reported in the variable: SELECT SUM(valor_pag) FROM controle WHERE MONTH(data_paga) < 07 and YEAR(d...
asked by 15.07.2017 / 23:27
1
answer

Revision in query

I have this query in order to list users with more comments, however, it can not display users with the banned column = true. SELECT * FROM usuarios a INNER JOIN topicos_comentarios b ON a.usuario = b.autor WHERE a.banido <> true GROU...
asked by 05.07.2017 / 23:01
2
answers

Give a select to return the unique values

I have multiple values repeated, the value can have status (different or different) or I can have two values with different / differentiated statuses, and I need to make a comparison between them (in this case I use a key). unique that are diffe...
asked by 12.05.2017 / 21:16
1
answer

Query where result equal to any of the values in the list

I have a table of Duplicates that has the referring month as string, (ex: 01/2012, 05/2016 and etc) I need to perform a query between a date range, if the field were DateTime I know that I would just use > = and < = but being a st...
asked by 28.04.2017 / 14:21
1
answer

MySQL, use sum quantity (total) 10 in WHERE

I have the following MYSQL query: SELECT SUM(A.val) AS totalvendas, B.cod AS codigo, B.nom AS Nome, B.reg AS regiao FROM venda AS A LEFT JOIN vendedor AS B ON A.ven = B.cod WHERE reg = "norte" GROUP BY A.ven ORDER BY totalvendas DESC; It...
asked by 19.05.2017 / 06:21