Questions tagged as 'postgresql'

2
answers

How to truncate a date with time in postgresql?

Execute: SELECT NOW() and it appears to me: '2017-08-07 10:53:44.207-06' And I want to appear '2017-08-07'     
asked by 07.08.2017 / 18:55
1
answer

Do a SELECT between two databases on the same server - postgresql

Good evening Titans of programming I have a problem, I'm trying to make a selection between two different databases that are on the same server, this is the query I do: SELECT A.nodo, B.nodo FROM camper.public.camper1 A INNER...
asked by 12.06.2018 / 02:26
1
answer

Multiplication hours x number

I have the case of a time worked and his salary for hours. I need to calculate how much they have charged: SELECT '07:45'::time as horas_trabajadas, 8.45::numeric(18,2) as precio_hora, '07:45'::interval * 8.45 as total_dia H...
asked by 12.12.2018 / 12:44
1
answer

Search string within a text field, PostgreSQL

I have the following problem: I need to find an exact substring that begins and ends with numbers in a text field. The query at the moment is: SELECT * (...) FROM dominio AS Dom, ampliatoria AS Amp, (...) WHERE (...) AND Amp.descri...
asked by 18.12.2018 / 14:54
1
answer

How to leave by default that hibernate does not interfere with the serial type Id of postgresql?

I have a field ID in PostgreSQL of type serial , to be auto-incremental. But when I do the mapping with Hibernate the .xml of the table is saved like this: '<class name="Model.Persona" table="persona" schema="public" o...
asked by 14.12.2018 / 22:02
1
answer

Problem with class extends in PHP

I have a problem with a class, in which I extend the Conn class which is my database connection. The error is    Class 'Conn' not found in ... <?php class User extends Conn{ private $nombre; private $username; public fun...
asked by 25.11.2018 / 15:30
2
answers

Object of class Conn could not be converted to string in

The following error is presented to me when designing queries to the database, I enclose the source code: Validations.php: <?php session_start(); if(isset($_SESSION['usuario'])){ header('Location: vistas/home.php'); } if($_SERVER['REQ...
asked by 26.11.2018 / 04:22
1
answer

SQL query Advanced filter with Postgres

I have this database model I want to make a query that meets the following conditions. all students must be listed I want to be able to see the type of characterization only of the characterization with the highest order semester...
asked by 20.11.2018 / 06:31
2
answers

Count number of SQL records in the same field

It is possible to count how many records there are in a query, I want them to appear as one more column since the query should throw a single row. SELECT dep.nombre as departamento, sum(cap.total_mosquitos) as total_mosquito...
asked by 04.05.2018 / 17:06
2
answers

Many-to-many relationships postgrest, consultation to take out in a single row

I have a table A : ----------------------------- | id | nombre | cel | ----------------------------- |1 | Juan | 1653727| |2 | Pedro | 6353526| |3 | Hernan | 4465672| ----------------------------- Another ta...
asked by 03.06.2018 / 20:58