Questions tagged as 'select'

2
answers

Passing values from a select to subselect

I have the following query: SELECT rp.colaborador as codigo_, t.nome, count(rp.*) as presencas, ((100 * (select count(rp.*) from empresa.cad_reuniao_presencas rp join empresa.cad_terceiros t on t.codigo = rp.colaborador join emp...
asked by 21.05.2015 / 18:51
2
answers

Get the optgroup label and option value and show it in a div with Jquery

I have the following code: <select> <optgroup label="fruta"> <option value="banana">banana</option> <option value="uva">uva</option> </optgroup> <optgroup label="l...
asked by 08.07.2015 / 13:11
0
answers

Result interval

I have a table where records are saved every 3 seconds 24 hours a day Table: myTable dado1 dado2 dado3 data "135,05" "134,69" "135,10" "2018-11-13 15:38:16" "132,00" "131,91" "132,61" "2018-11-13 15:...
asked by 14.11.2018 / 19:15
1
answer

Problems with select in multiple tables

I'm trying to do the conversion from a select sql server to the Dapper, as it was too big, I'm wanting to make it leaner and readable ... But this error appearing in some parts SELECT email.assunto [Assunto], disp.cod_disparador [Dispa...
asked by 19.09.2016 / 17:46
2
answers

SQL query with PHP array [duplicate]

I have an array that will be variable, eg $ ref = array ('123', '654', '555'). I wanted to do a SQL query to bring information from these references, something like: SELECT * FROM tabela_itens WHERE ref = (array do PHP) How can I do th...
asked by 02.05.2018 / 19:56
2
answers

Using WHERE with INNER JOIN [duplicate]

Is there a way to use WHERE to make a SELECT with INNER JOIN ? My case is this: SELECT CodCli, NomeCli FROM tbvendas INNER JOIN tbclientes ON tbvendas.CodCli = tbclientes.AutoCod I would like to put a WHER...
asked by 17.11.2016 / 15:57
3
answers

Column outside the WHERE condition of SELECT

I need to make a query that returns a column with the amount of requests the customer made within the period spent in WHERE and together with another column with the total number of requests that the customer has made so far. More or less like t...
asked by 18.12.2014 / 19:11
2
answers

Select with INNER JOIN, bringing fields that have foreign key NULL

I have a table of items, request_itens, interested (it has auto relationship, it is used for secretary, sector and employee, and a requested table), in the order table I have 3 foreign keys (one for secretariat, another for sector and one more f...
asked by 27.05.2016 / 23:21
1
answer

Doubt, query does not work exactly as I want ... PHP

I have a table in the database called emails , with the following fields: id subject body e status (0, para não enviado, ou 1, para enviado). I was doing a query to retrieve only the rows that have status 1, my SQL query was: "SE...
asked by 21.07.2014 / 02:14
1
answer

Make an INNER JOIN using the IF

I'm doing an INNER JOIN from the Combo Table with the Product Combo Table as I show below ... SELECT C.SchoolID, C.ComboID, P.Active, P.Name, P.ProductID FROM sales.Combo AS C INNER JOIN commons.Stock AS S ON C.SchoolID = S.SchoolI...
asked by 16.04.2014 / 18:55