Questions tagged as 'postgresql'

1
answer

Group 2 count () in a query in PostgreSQL

These are the tables in my database: animal _________________ |id_animal | zona | |__________|______| | T1 | 01 | |__________|______| | B1 | 01 | |__________|______| | C1 | 01 | |__________|______| | C2 | 01...
asked by 18.04.2018 / 23:33
1
answer

SQL queries shown in a html + php table

At the moment I am working on a simple sql query through a search contained by a word stored in a variable, where I make a select and ask that I show the results in a table in html, but the problem is that if that word has several records create...
asked by 08.04.2018 / 22:56
1
answer

delete scientific notation in a csv file [closed]

I have a problem, when generating a .csv file with php when opening it in excel a field that I have named as a location card that has more than 15 numeric characters when opened it changes it to this notation The idea is that when opening the...
asked by 19.03.2018 / 15:22
1
answer

final part of a QUERY

I am finishing a query that I have been asked but I can not finish it, the structure of the tables is as follows: child CREATE TABLE CHILD( child_id SMALLINT, child_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, gender VARCHAR(255)...
asked by 30.10.2017 / 19:08
1
answer

Laravel update status of records

Good I need to automatically update the status of my budget to "Due" when the expiration date has already passed my budget table: id fecha_emision status total fecha_expiracion cod_us...
asked by 02.07.2017 / 23:47
2
answers

How to transform a SQL query into a panda dataframe matrix?

I want to set an array from a postgresql database so that we have the eclipse_id by the heading and the subscriber_id by the side. > data.head(6).ix[:,2:8] 1222 52582 45552 122 589 568 0 0 0...
asked by 01.06.2017 / 16:30
1
answer

How can this sql query be transformed in postgresql to query in django

Good morning to all: I have the following query in postgresql that returns the Id of the last contract that a worker has signed with a company in 2016 (from 01/01/2016 to 12/31/2016), as well as their paternal surnames and maternal, name, sta...
asked by 25.03.2017 / 13:16
2
answers

Reverse rows to columns with SQL

I need to make a select that shows rows as columns from a table, using the SQL language ie - Table DESC | ENERO | MARZO | JUNIO A | 80 | 73 | 84 B | 100 | 100 | 100 What I need is that you show me the query DESC |...
asked by 07.12.2016 / 15:44
2
answers

Fix PHP date problem (CODEIGNITER)

In a controller I am sending 3 parameters to a model so that the boolean responds, and it always pulls out false, I have done tests so that the model returns what it is receiving and this is what it throws at me .. ["SE INGRESAN 10 NUEVOS PR...
asked by 01.03.2017 / 21:03
3
answers

Query To know if a table field exists or does not exist in PostgreSQL

I can not find the way to do the query to create a field in a table and a foreign key in a PostgreSQL database, but previously verifying that it does not exist. In SQL server I use the following but they do not work in PostgreSQL 9.1. --- para...
asked by 08.09.2016 / 20:26