Posts by Anonimo • 91 points
10 posts
-
0
votes1
answer862
viewsA: Create algorithm that calculates LOG in visualg
Mathematically: log b(x) = log k(x) / log k(b) where b and k are bases. So log x in base 2 in Visualg would be: log(x) / log(2)
-
0
votes1
answer150
viewsA: Are there classification metrics for the elaboration of SQL queries?
You tried to: SELECT SUM(CITY.POPULATION) FROM CITY INNER JOIN COUNTRY ON (CITY.COUNTRYCODE = COUNTRY.CODE) WHERE COUNTRY.CONTINENT = "Asia"); Remember that SQL is a declarative language, don’t…
-
0
votes4
answers3710
viewsA: Doubt with month and year extraction in Postgresql date
You can also use the date_trunc function: date_trunc('month', TIMESTAMP '2001-02-16 20:38:40') which it will obtain as a result: 2001-02-01 00:00:00…
-
0
votes2
answers1598
viewsA: How do Postgres create a file to populate a bank?
Use the pg_dump utility: https://www.postgresql.org/docs/current/static/app-pgdump.html…
-
1
votes3
answers952
viewsA: Save date in Brazilian format in Postgresql
You are confusing storage format with date or timestamp field display format. You cannot change the storage format of these data types but can change the display format. Refer to section 8.5.2.…
-
2
votes1
answer887
viewsA: Matrix multiplication by matrix transposed in C language
First of all the product of two matrices is defined only when the number of columns of the first matrix is equal to the number of rows of the second matrix. #define L 3 #define M 4 ... int…
-
1
votes1
answer61
viewsA: Ireport report showing up without data
Or use: SELECT * FROM venda WHERE data between $P{dataInicial} AND $P{dataFinal}; or use: SELECT * FROM venda WHERE venda.data >= $P{dataInicial} AND venda.data <= $P{dataFinal};…
-
0
votes3
answers814
viewsA: Problem with accentuation when saving text in the database
Use compatible client-encoding and server-encoding. Refer to the manual: https://www.postgresql.org/docs/current/static/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT…
-
1
votes1
answer57
viewsA: reversing a long sequence in c
Use the 0* specifier to specify the size of the field to be printed with zeros on the left. For example for a 5-position field: printf("%0*lld\n", 5, 123); In your case you need to determine the…
-
0
votes2
answers527
viewsA: Format date when performing Update in the registry - Postgresql
When displaying use: to_char(seu_campo_data, 'DD-MM-YYYY')