Questions tagged as 'postgresql'

4
answers

Filter numbers not yet registered via SQL

I'm trying to find the numbers that have not yet been registered at the bank. I have a client table, in it I have the fields codigo and nome . When the user registers the client, he places the code manually, so he runs the ris...
asked by 29.05.2015 / 15:26
2
answers

Trigger error

I'm making a system that moves cattle tracking and I'm having a question about creating triggers after update. The situation is this: in my bank there are several tables that have foreign keys to each other. Within these tables, there are the...
asked by 29.10.2016 / 23:13
3
answers

It is possible to get data from the entire month in postgreSQL

How do I get all the data stored in the database from a specific month: I think you should pass the year / month as a parameter, for example, variable="2016/10"; remembering that the type of the data in the database and timestamp SELECT * FR...
asked by 20.10.2016 / 20:00
1
answer

Arbitrary Decimal Truncation with PostgreSQL

I am doing an SQL query using the sum() function. This function adds integers and fractional numbers. The problem is that it returns a double precision with a very large number. How do I limit to two decimal places after the point? C...
asked by 30.10.2016 / 18:54
2
answers

Problem writing data to Postgres

I have two tables in postgres (PRODUCT and CATEGORY) In the PRODUCT table I have the FIELDS - > ID, productName, description, value, Category ID . In the CATEGORY table I have the FIELDS - > Category ID In my project in Visual S...
asked by 01.10.2015 / 20:54
1
answer

PostgreSQL compilation error

Someone could tell me if there is an error in the query below: select name, cast(Extract(day from payday) as int) as 'day' from loan; I can not find the reason for having a compile error in the URI.     
asked by 05.11.2018 / 01:33
1
answer

PostGreSQL compilation error - Error

I'm trying to run this query in postgresql but it gives compilation error: select can.name as 'name', ((sco.math 2) + (sco.specific1 3) + (sco.project_plan * 5)) / 10) the "avg" from candidate can join score sco on can.id = sco.candidate_id o...
asked by 05.11.2018 / 21:07
1
answer

First and Last record including night

I'm having the following problem I have the data this way: codigo data_hora nome_ajudante -------+----------------+-------------- 1000004 2018-08-22 11:11 Carlos Eduardo 1000004 2018-08-22 11:43 Carlos Eduardo 1000004 2018-08-22 11:48...
asked by 28.08.2018 / 22:57
1
answer

Query to sum total query

I have a Query to select a user list with debits I have to make the sum of these debits. SQL /* * PAGAMENTO */ SELECT pe.name as nomepessoa, py.created_at as datapagamento, py.amount_paid as pagamento, pys.name as status FROM...
asked by 27.10.2017 / 22:35
4
answers

Doubt with month and year extraction in PostgreSql data

I'm using a select command where I get the month and date year as follows: extract(year from D.dt_ficha) + extract(month from D.dt_ficha) But instead of appearing like this: 201711 November 2017, it is adding 2017 + 11 202...
asked by 09.11.2017 / 15:33