Questions tagged as 'select'

1
answer

select with multiple BETWEENs

Good people, I need a help, I'm doing a filter and to do the select I did so: $molcomp_query="SELECT * FROM stock_comp WHERE (diametroaco BETWEEN '$d1' and '$d2') AND (comprimentototal BETWEEN '$comp1' AND '$comp2') AND (diametroexte...
asked by 10.05.2018 / 10:35
1
answer

Real size auto fit of the select via option available

I usually search and do not disturb the patience of the members here, but this time I specifically need an example. See: <!DOCTYPE html> <html> <body> <select id="lista" size="4"> <option value="A">...
asked by 10.05.2018 / 03:48
2
answers

Select multiple tables by arranging by date

mysql> SELECT * FROM COLABORADOR; +----+----------+ | ID | NOME | +----+----------+ | 2 | FULANO 2 | | 3 | FULANO 3 | +----+----------+ 2 rows in set (0.00 sec) mysql> SELECT * FROM JORNADA; +----+---------------------+--------------...
asked by 15.10.2017 / 23:29
1
answer

Select two tables with different columns in ORACLE

I have three tables, one call ALUNO , one call MATRICULA , and another call CLASSE , and I need to select all students who are male and belong to the same class as a student who has a RGM specific. The tables are: STUDEN...
asked by 14.11.2017 / 01:28
1
answer

Separate column in multiple lines (split)

I have a cidade_bairro table with several cities and neighborhoods. I want to transfer this data to a new table, but on several lines instead of being in one. EX: Cidade Bairros<br> SP | Consolação-Morumbi-Saude In the n...
asked by 13.09.2017 / 20:34
1
answer

Error using "greater than" in select command with case

I'm trying to run the following select command: SELECT estoque.id, produto.id, produto.descricao PRODUTO, case saida.quant when > 0 then (estoque.quant + sum(saida.quant)) else estoque.quant end ESTOQUE FROM estoque, saida, produto join pr...
asked by 16.08.2017 / 04:33
1
answer

Select with when and case

I have the following select query: select F.nu_ine INE, to_char(D.dt_ficha, 'YYYYMM') as CMP, I.co_cbo_2002 CBO, CASE WHEN (B.tp_atend = 1 or B.tp_atend = 2 or B.tp_atend = 5) and I.co_cbo_2002 != '225142' THEN '0301010030' WHEN (B.tp_atend =...
asked by 09.11.2017 / 19:04
1
answer

Doubt referring to IN in Oracle

I'm setting up a query and I came up with an issue. My query looks like this: SELECT BASI_030.NIVEL_ESTRUTURA NIVEL, BASI_030.REFERENCIA GRUPO, BASI_030.DESCR_REFERENCIA, BASI_030.CONTA_ESTOQUE, BASI_020.TIPO_PRO...
asked by 07.07.2017 / 15:31
2
answers

Doubt with SELECT in MYSQL database

I need an sql that, in the table below, always brings the last insert for each user. I tried with distinct but it did not work. So in the case below sql would bring the results of line 2 and 5. Detail that there are more columns (city, country,...
asked by 17.07.2017 / 23:00
2
answers

Read values from a column - C #

I need to read the values of a column called Code_Article and put them, but when the column is still empty, I run and give the error: p>    The object reference was not defined as an instance of a   object. Here is my code: conn.Open(...
asked by 28.04.2017 / 17:45