Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

PostgreSQL SQL Recent threads

Threads Replies First post Last post
Select row cells as new columns
By: danycxxx
Hello. I hope you can help me with this or at least guide me into the right direction: I have 2 tables: CREATE TABLE infos ( id integer NOT NULL DEFAULT nextval('info_id_seq'::regclass), name text NOT NULL, id_member integer NOT NULL, …
2 May 25 2012
04:04
May 25 2012
07:58
Job control in sql
By: Svenne Krap
This is a multi-part message in MIME format.Hi. I am building a system, where we have jobs that run at different times (and takes widely different lengths of time). Basically I have a jobs table: create table jobs( id serial, ready…
1 May 25 2012
03:29
May 25 2012
07:56
Flatten table using timestamp and source
By: Elrich Marx
Good day. I am quite new to Postgres, so please bear with me. I have a table with data in the following format: Table name : Time_Source_Table Source , Stime 1, "2012-05-24 13:00:00" 1, "2012-05-24 13:01:00" 1, "2012-05-24 13:02:00" …
3 May 24 2012
04:02
May 25 2012
00:52
Inherited table identification possible
By: George Woodring
Is it possible to identify which inherited table data came from in a query? We have a table that has 3 inherited tables attached to it. I am looking for a way to identify the source of the data. My only thought would be to add a column to the…
2 May 24 2012
13:02
May 24 2012
13:11
Understanding Binary Data Type
By: Carlos Mennens
Hello everyone! I wanted to ask the list a question about the 'bytea' data type & how I can picture this in my head. I've been reading SQL for about a few months now and since then, I've only been working with textual data. Basically I'm…
1 May 22 2012
12:14
May 24 2012
11:37
Re: left outer join only select newest record
By: Oliveiros d'Azevedo Cristina
Hi, Gary, Unless I'm mistaken this didn't give what you need. Could you please tell me (if you have time) the error returned or wrong result, just for my own understanding of where I've gone sideways on this...? Best, Oliver ----- Original…
0 May 24 2012
03:28
May 24 2012
03:28
left outer join only select newest record
By: Gary Stainburn
Hi folks, I know I've seen posts like this before but Google isn't helping today. I have two tables, vehicle stock and tax requests. Each vehicle can be taxed more than once, but I only want to pull in the most recent tax request - the one with…
9 May 23 2012
04:28
May 24 2012
03:22
sub query and AS
By: Ferruccio Zamuner
Hi, I like PostgreSQL for many reasons, one of them is the possibility to use sub query everywhere. Now I've found where it doesn't support them. I would like to use a AS (sub query) form. This is an example: First the subquery: select…
2 May 23 2012
04:25
May 24 2012
02:08
Re: Understanding Binary Data Type
By: Jasen Betts
On 2012-05-22, Carlos Mennens <carlos.m### @gmail.com> wrote: > Hello everyone! I wanted to ask the list a question about the 'bytea' > data type & how I can picture this in my head. I've been reading SQL > for about a few…
0 May 24 2012
01:32
May 24 2012
01:32
Need help in grouping records
By: Andreas
Hi, I'm trying to fight against double entries in tables. I got as far as I can find similar records with trigram string matching. If I do this with a table compared to itself I get something like this: id_a, id_b 3, 5 3, 7 5, 3 5, 7 7, …
6 May 19 2012
14:05
May 23 2012
15:26
Re: master/detail
By: Jan Bakuwel
This is a cryptographically signed message in MIME format. Hi Andreas and Mario, Many thanks for your suggestion to use PostgreSQL's window function, exactly what I needed. kind regards, Jan
0 May 22 2012
02:29
May 22 2012
02:29
Select every first/last record of a partition?
By: Andreas
Hi, suppose a table that has records with some ID and a timestamp. id, ts 3, 2012/01/03 5, 2012/01/05 7, 2012/01/07 3, 2012/02/03 3, 2012/01/05 5, 2012/03/01 7, 2012/04/04 to fetch every last row of those IDs I do: …
1 May 21 2012
11:05
May 21 2012
16:18
order by different on mac vs linux
By: Wes James
I have postgresql 9.1.3 on a mac and on linux. On the mac the results come out: ! *`-=[];',./~@#$%^&()_+{}|:"<>?\ then \--\ On ubuntu 12.04 x64 it comes out (compiled and installed postgres from tbz2 from postgresql.org repo): \--\ …
10 May 14 2012
17:42
May 16 2012
21:24
SELECT 1st field
By: Jan Bakuwel
This is a cryptographically signed message in MIME format. Hi, I've spend some time checking the documentation but haven't been able to find what I'm looking for. I've got a function that returns a set of integers and a view that selects from the…
4 May 15 2012
01:02
May 15 2012
18:31
Finding Max Value in a Row
By: Carlos Mennens
I have a problem in SQL I don't know how to solve and while I'm sure there are 100+ ways to do this in ANSI SQL, I'm trying to find the most cleanest / efficient way. I have a table called 'users' and the field 'users_id' is listed as the PRIMARY…
16 May 11 2012
14:04
May 15 2012
06:01
Re: SELECT 1st field
By: Misa Simic
When you select from function I think column name is the same as function name. So if function name is func query would be: SELECT func AS id FROM func(5); Sent from my Windows Phone From: Jan Bakuwel Sent: 15/05/2012 08:02 To:…
0 May 15 2012
03:07
May 15 2012
03:07
syncing - between databases
By: John Fabiani
I need to maintain a sync-ed table across several databases. For example I have a customer table in 5 databases. If a user of any of the databases inserts a new customer I need to insert the new record into the other four databases. But…
7 May 12 2012
09:29
May 14 2012
07:04
Re: Finding Max Value in a Row
By: Jasen Betts
On 2012-05-11, Carlos Mennens <carlos.m### @gmail.com> wrote: > I have a problem in SQL I don't know how to solve and while I'm sure > there are 100+ ways to do this in ANSI SQL, I'm trying to find the > most cleanest / efficient…
0 May 11 2012
17:02
May 11 2012
17:02
pg_dump: aborting because of server version mismatch
By: Mitesh Shah
Hi, I am trying to create a daily backup cron script but it fails with an error as below: Any pointers to resolve this will be greatly appreciated. Thanks, Mitesh Shah mitesh### @stripes39.com *(1) Error:* bash-3.2$ sh pg_backup_rotated_orig.sh…
3 May 3 2012
02:36
May 11 2012
14:41
How change col name during query to use it in where clause
By: Marcel Ruff
Hi, is an alias name not usable in the where clause? select EXTRACT(day from enddate::TIMESTAMP - old_enddate::TIMESTAMP) AS TAGE from account_h where TAGE>5; ERROR: column "tage" does not exist LINE 1: ... TAGE>5 ... Thank you Marcel …
3 May 4 2012
07:12
May 4 2012
08:05