Re: [SQL] left join not working?

2010-02-12 Thread Oliveiros C,
My first guess is that NULL fails the condition on your WHERE clause, p.id_line = 1 So your WHERE clause introduces an additional level of filtering that filters out the NULLs coming from the LEFT JOIN... Didn't do any tests, it's just a guess... Best, Oliveiros - Original Message -

Re: [SQL] left join not working?

2010-02-12 Thread Oliveiros C,
Message - From: Louis-David Mitterrand vindex+lists-pgsql-...@apartia.org To: pgsql-sql@postgresql.org Sent: Friday, February 12, 2010 11:57 AM Subject: Re: [SQL] left join not working? On Fri, Feb 12, 2010 at 11:35:02AM -, Oliveiros C, wrote: My first guess is that NULL fails

Re: [SQL] selecting rows tagged with a but not b

2010-02-01 Thread Oliveiros C,
Darrell, Can you provide a little more information and background on your problem. please? What values can the tag column assume? Just a and b ? Both? Please give examples of table contents and desired output, your mail doesn't contain enough info to give you more advises Thank you

[SQL] Is there any function to test for numeric ips?

2009-12-11 Thread Oliveiros C,
Dear All, I have a table with host names and some happen to be numeric IPs. I would like to be able to filter out the later. Is there any function pre-defined in the system that can test a particular text type value to see if it is a numeric ip? Something that returns true if applied to

Re: [SQL] Is there any function to test for numeric ips?

2009-12-11 Thread Oliveiros C,
subjects like pgplsql not to mention regular expressions Thanx a lot for your fast help, Best, Oliveiros - Original Message - From: Alvaro Herrera alvhe...@commandprompt.com To: Oliveiros C, oliveiros.crist...@marktest.pt Cc: pgsql-sql@postgresql.org Sent: Friday, December 11, 2009

Re: [SQL] need nelp with aggregate functions

2009-11-19 Thread Oliveiros C,
appearing more than once... It's basically that... Hope this helped Best, Oliveiros - Original Message - From: Another Trad To: Oliveiros C, Cc: pgsql-sql@postgresql.org Sent: Wednesday, November 18, 2009 5:37 PM Subject: Re: [SQL] need nelp with aggregate functions ok, I

Re: [SQL] need nelp with aggregate functions

2009-11-18 Thread Oliveiros C,
Try substituting the SELECT count(c) as qtd_client,count(cm) as qtd_computers by SELECT count( DISTINCT c.cliente_id) as qtd_client,count(/* put here the primary key of the computer table */ ) as qtd_computers Then tell me if it output what you want Best, Oliveiros - Original Message

Re: [SQL] How to order varchar data by word

2009-10-20 Thread Oliveiros C,
, Oliveiros - Original Message - From: Tom Lane t...@sss.pgh.pa.us To: Oliveiros C, oliveiros.crist...@marktest.pt Cc: Adrian Klaver akla...@comcast.net; pgsql-sql@postgresql.org Sent: Monday, October 19, 2009 6:32 PM Subject: Re: [SQL] How to order varchar data by word Oliveiros C

Re: [SQL] How to order varchar data by word

2009-10-20 Thread Oliveiros C,
- Original Message - From: Adrian Klaver akla...@comcast.net To: Oliveiros C, oliveiros.crist...@marktest.pt Cc: Tom Lane t...@sss.pgh.pa.us; pgsql-sql@postgresql.org Sent: Tuesday, October 20, 2009 2:46 PM Subject: Re: [SQL] How to order varchar data by word On Tuesday 20 October 2009 6:39:23

Re: [SQL] How to order varchar data by word

2009-10-19 Thread Oliveiros C,
Message - From: Adrian Klaver akla...@comcast.net To: pgsql-sql@postgresql.org Cc: Oliveiros C, oliveiros.crist...@marktest.pt Sent: Wednesday, October 14, 2009 9:54 PM Subject: Re: [SQL] How to order varchar data by word On Wednesday 14 October 2009 7:13:22 am Oliveiros C, wrote: Hello

[SQL] How to order varchar data by word

2009-10-14 Thread Oliveiros C,
Hello, list. I have a table with a varchar field that I would like to order by word, not by ordinal, which seems to be the default on postgres. Does anyone have a clue on how this can be done? Many thanx in advance, Best, Oliveiros

Re: [SQL] simple (?) join

2009-09-28 Thread Oliveiros C,
Hello, Gary. thank you for your e-mail This is a slightly modified version of the query I sent you on first place (have you tried it out?). It will return (I hope :) the full orders record plus the maximum ol_timestamp and respective o_user. HTH Best, Oliveiros SELECT subquery.*,

Re: [SQL] simple (?) join

2009-09-24 Thread Oliveiros C,
You mean to list the complete orders table and for each of its records, the corresponding record on the orders_log with the latest ol_timestamp? SELECT * FROM orders_log main JOIN ( SELECT orders.*, MAX(orders_log.ol_timestamp) as latest FROM orders NATURAL JOIN orders_log GROUP BY orders.*

Re: [SQL] simple (?) join

2009-09-24 Thread Oliveiros C,
Message - From: Oliveiros C, oliveiros.crist...@marktest.pt To: Gary Stainburn gary.stainb...@ringways.co.uk; pgsql-sql@postgresql.org Sent: Thursday, September 24, 2009 6:17 PM Subject: Re: [SQL] simple (?) join You mean to list the complete orders table and for each of its records

[SQL] Differences between bit string constant sintax

2009-09-09 Thread Oliveiros C,
Dear All, I have a table which has a field that is of type bit varying. When I do a direct INSERT with , say, X'1F', everything works fine. But in this table I have to insert several tens of thousands of records each time, so I decided to use COPY command. And if I build a file like this