Questions tagged as 'select'

1
answer

select on elements that are not in array [duplicate]

I have an array in PHP with IDs: $idNaoEnvia['1', '3', '6'] And a table named account in MYSQL: ID | NOME 1 | caio 2 | antonio 3 | cleber 4 | marcos 5 | leonardo 6 | andre I wanted to use PDO to give a select in the a...
asked by 23.08.2016 / 00:08
1
answer

I can not perform a Select

I have a question about how I should mount SELECT for a given function. The scenario is as follows: I have 4 tables: Tab_Pessoa - Tab_Cliente - Tab_Autorizado - Tab_Cliente_Autorizado . So the Tab_Pessoa is related to...
asked by 12.01.2015 / 14:15
1
answer

Show latest results however with ASC ordering in PHP

I would like to show the last 10 results found in a table, but with ASC ordering. I'm using the following: $listarResultados = $pdo->prepare("SELECT * FROM teste WHERE categoria = 'cateste' ORDER BY id ASC LIMIT 10"); $listarResultados ->...
asked by 15.08.2015 / 23:15
2
answers

Using select to open iframe

I have a code and I want it to open a path in iframe when I click on a option of select . I was able to do this, however to change the option so that it opens something else in iframe I have to refresh the page. If I c...
asked by 09.05.2014 / 16:23
1
answer

Doubt in SQL query ORACLE

I'm thinking of doing a View for report development, and I ran into the following problem. I would like to merge the columns PUBLIC1, PUBLIC2, PUBLIC3, PUBLIC4 into a single column. Eg: AM0173 would have 2 lines ID_3_ETAPA | PUBLI...
asked by 06.03.2017 / 14:22
1
answer

Order increasing and decreasing angularjs

I have a dataset that organizes it by choosing, growing or decreasing, or I can leave it in the order that it already is. The system works normally with the order of the elements, the problem is that the elements are only being shown when the sa...
asked by 06.12.2016 / 15:25
1
answer

How to do select auto relationship N: N

I am not able to perform a SQL query with N: N relationship. I have a user table and one with user_has_usuario self-relationship, which will be registered responsible and students (from a school) would like to list the students by the CPF of the...
asked by 23.12.2016 / 20:22
2
answers

How to bring the conditions entered as parameters into the SELECT result?

Is there any way to get the parameter values used in the SELECT clause in the WHERE result? Example: SELECT a.*, cast(:dataIni as date) AS inidate , cast(:dataFin as date) AS inidate FROM mytable a WHERE a.date BE...
asked by 02.08.2014 / 19:03
2
answers

Query N records by Item

I have a history table in DB2 and I would like to do a grouping by PLACA but despite this I would have to return the last 5 records of each PLACA . Ex: |ID |PLACA | DATA | VALOR | |12 |ABC | 2014-08-28 | 4.50 |...
asked by 28.08.2014 / 20:17
2
answers

Search XML field information in SQL

I need to search inside a field where I store an XML The XML is from a CT-e and has a series of tags in it and I need to find a data inside a specific tag. Below the table structure TheXMLhasthefollowingstructureandwithinitthefieldInee...
asked by 18.10.2017 / 17:34