Questions tagged as 'query'

3
answers

How to group by weeks using sql?

I have the following problem. I have several requests, and I want to group them for weeks. I have already seen several examples, but almost none helped me, I would like to know if there is a function that when placed in Group by the result of th...
asked by 07.03.2016 / 13:04
3
answers

List columns according to the current date

I have the following view: select * from chamdosrow It returns as follows: NOME 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 --------------------------------...
asked by 03.05.2017 / 13:42
1
answer

Presentation of the php query

I need to help me create a function in php that lists multiple tables in a row with multiple columns, depending on the amount of records in the database and the spacing of the tables defined by <div class="span"> This is my role,...
asked by 11.06.2016 / 10:52
3
answers

Select value other than "X" name

How do I select only the different ratings of "X" in a given column? I created the select below: SELECT top 1000* FROM [tabela_clientes] WITH (NOLOCK) WHERE STATUS= 'pendente' and status_2= 'pagamento' and REGIAO= 'sao paulo' --------...
asked by 04.06.2018 / 22:28
4
answers

How to retrieve a value from within a tag in XML?

I have a table called SPDNFE with a column DsXML that contains all contents of a Xml . Query: SELECT top 1 SPDNFE.DsXML FROM SPDNFE where SPDNFE.CdIdNFe = 'NFe32170710490181000569550040001475221002513963' Return of...
asked by 07.08.2017 / 16:42
1
answer

Make query not showing some results

I have a CPF table where the CPF's are registered. I need to make a SELECT where I display all the registered CPF's, minus 3 CPF's. Something like: SELECT * FROM cpf WHERE cpf_id <> '111.111.111.11,222.222.222.22,...
asked by 20.01.2016 / 13:38
2
answers

How to create a condition that does not include the month of December?

I'm creating a condition to be run before the month of December, that is, it only runs in the January period of November . IF (SELECT TarFechamento FROM Tarefa WHERE TarID = @Tarefa) < '01-12-2017' I put it like it was in the year of...
asked by 17.10.2017 / 19:06
1
answer

Extract data from a BLOB field in MySQL

I have a select where it has a column where it is returning me in <BLOB>    QUERY SELECT * FROM user WHERE user_id=1    RETURN: id data_cad user_data 12 2017-03-01 21:38:57 <Blob>    In the BLOB...
asked by 30.03.2017 / 23:49
2
answers

Problem to mount query

I can not mount a query, the logic is: Select produtos with categorias different, being the products with more points, thus I will have a product of more points of category X, another of category Y. I tried to use DISTINCT...
asked by 10.06.2015 / 19:53
1
answer

How to group subtraction of equal fields in MySQL?

I need to make an appointment that returns the employee's current balance. Being that in my modeling I separate the debts and credits of the employee by the fields type 1 for credits and 2 for debits. My query is not bringing the t...
asked by 10.12.2015 / 21:56