Questions tagged as 'query'

1
answer

Concatenate rows with the same code

When executing the query select * from ivr_interacao,ivr_business where ivr_interacao.codigo = ivr_business.idvisita and ivr_business.campanha = 5 order by start_time asc I have the following answer: CHAMADO ID VISITA NOME TELEFONE...
asked by 28.06.2018 / 17:14
1
answer

Select for a specific period in MySQL

I know that if I want to query the date 5 days ago, I use the following Query: SELECT * FROM Tabela WHERE Data = DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 5 DAY); Or want to go back two months ago I replace DAY with MONTH...
asked by 26.09.2018 / 20:01
2
answers

Query in same table

I have a movement table that has the worker's record and the events related to it, I wanted a query that would return only the records that have exactly the events e1, e2 and e3, in case of the example above the records would be 001 and...
asked by 25.05.2018 / 23:21
2
answers

Conversion from varchar to float when the string is empty and / or blank

I have a column where the strings are in the following format: " 12.05% " I need to do some calculations with these values, and I'm formatting the values that are acceptable for float / double format etc. I have the following line in my qu...
asked by 09.05.2018 / 18:28
1
answer

Is there a way to change the field type of a query in delphi without having to delete and include it?

I have the following situation, I use PostgreSQL and Zeos in DelphiXE, I needed to update the component to better support LATIN1 x UTF-8, now I can work with all kinds of characters, blz. But another problem came up, some fields that were Mem...
asked by 26.04.2018 / 17:24
1
answer

Group sum by month and year

I have a simple table in a FIREBIRD database: idCliente: integer dataPagamento: date valor: numeric How to make a select that adds up all the amounts to be paid by grouping by month and year? type like this: select MES_ANO, sum...
asked by 11.06.2018 / 21:48
1
answer

How to format the numbers directly through SQL

Gentlemen, my numbers are coming out unformatted when I make the select directly in the bank, they are coming out as follows: REALIZADO META 61274436,2090003 80000000,00 How can I make them readable for anyone to interpret?...
asked by 30.07.2018 / 20:50
1
answer

Query to return text from the middle of a field

I have a query that returns some class names / disciplines , however I wanted it to bring me just the names of the disciplines . Below is the result of the query with the [class] [discipline_name] [branch]: ADM N1A OFFICIAL COMMUNICATION...
asked by 09.02.2018 / 22:35
1
answer

How to handle Null fields in PostgreSQL [duplicate]

Hello, I need to know how best to use COALESCE to handle the null fields in my table. My problem is the following, I'm simulating 6 Stores and their respective cards, let's suppose that one or more stores did not sell product in the Amex card,...
asked by 07.02.2018 / 21:42
1
answer

Add Count () in mysql

I have this query that returns me the number of dates equal: SELECT 'Data', COUNT('Data') AS 'Quantidade' FROM sua_tabela GROUP BY 'Data'; | Data | | 2016-06-09 | | 2016-06-09 | | 2016-06-09 | | 2016-06-08 | | 2016-06-08 |...
asked by 09.02.2018 / 13:12