Questions tagged as 'select'

2
answers

MySQL - Multi SELECTs in a query

I need to get all the columns of a table and a custom column in the same query, I tried this way: SELECT (SELECT * FROM clans WHERE ID=1), (SELECT COUNT(*) FROM contas WHERE Clan=1) AS Membros; It is giving error by trying to get more than...
asked by 19.07.2017 / 01:09
0
answers

Shopping cart error in array when retrieving last id sqlsrv_fetch_array 11- is not a valid ss_sqlsrv_stmt resource in

I am putting together a shopping cart but I am facing the following error which I mentioned in the title. The method receives 2 parameter $ listProducts is an array as all purchase information and the $ Total parameter receives $ _SESSION of the...
asked by 23.07.2017 / 16:50
2
answers

Sum with inner join Oracle

People need help, I need to create a report that shows the total quantity of each product in stock, but I can not get the name of the products, only the product code and the sum of the quantity of the products I have. Here is the code I did: S...
asked by 30.06.2017 / 15:57
1
answer

"ORA-01417: a table may be extra joined to at most one other table"

I'm setting a select and I came across the following error:    ORA-01417: a table may be extra joined to most other table SELECT A.SEQPESSOA, A.NUMERONF, A.NROEMPRESA, A.SEQPRODUTO, D.SEQCONTRATO, E.PERCDESCONTO, D.SEQCONTRATO, E.SE...
asked by 26.06.2017 / 23:17
1
answer

Row Results in Columns (SOMA)

Good afternoon, I have a big question in my query, I have a table with the following info: Iwouldliketogetthefollowingresult I need the result to be the total amount of (payment forms) per day, divided by period in two columns, M and N....
asked by 12.06.2017 / 19:57
1
answer

Limit and Offset for web paging in SQL Server

I'm working with PHP and I have about 8000 records currently in DB. As it is for a web page, I need to make a pagination to be viable reading the data. As I understand it, I have to do something similar to limit and offset to...
asked by 28.11.2016 / 13:35
2
answers

SELECT on a date in the range of ONE entered date and the date of the next record

How to generate a select that brings the date between an informed date and the date of the next record? In the Cargos table I only have a date, not a data_inicio and a data_fim , and I need to know the date between th...
asked by 31.05.2017 / 15:13
1
answer

Explode and compare value in a Select?

In my MySql I have the following column data_id it stores values in this 120-01-01 format, as would be SELECT that would make a EXPLODE in that field and check if the first value of array than in case would...
asked by 30.05.2017 / 21:35
1
answer

Help to display bank data on screen

I'm doing an INNER JOIN between two tables in my bank. But I'm having trouble showing the result organized on the screen, could anyone help me? The tables are category and service (related to category). In the category table I have only the id a...
asked by 30.05.2017 / 21:03
0
answers

Add column to SQL considering some conditions to be valid

I'm trying to put together two pieces of information and I'm not getting it. I set up this SQL to bring me only the products that were purchased that had a discount through a contract. But this discount was registered for the product categori...
asked by 19.06.2017 / 22:59