[SQL] How to find missing values across multiple OUTER JOINs

2007-06-06 Thread Drew
I'm having troubles using multiple OUTER JOINs, which I think I want to use to solve my problem. My problem is to find all non-translated string values in our translations database, given the 4 following tables: SOURCE (source_id PRIMARY KEY, language_id, value, ...) TRANSLATION

Re: [SQL] JOIN

2007-06-06 Thread Loredana Curugiu
Oliveiros, I think it's time to give some more details about my task. I will start with the begining :) I have a log table which stores the dates when users send messages with a theme from their mobile phone. This table is named sent_messages and looks like this: receiver | theme |

Re: [SQL] How to find missing values across multiple OUTER JOINs

2007-06-06 Thread Ragnar
On þri, 2007-06-05 at 23:55 -0700, Drew wrote: I'm having troubles using multiple OUTER JOINs, which I think I want to use to solve my problem. My problem is to find all non-translated string values in our translations database, given the 4 following tables: SOURCE (source_id PRIMARY

Re: [SQL] How to find missing values across multiple OUTER JOINs

2007-06-06 Thread Richard Huxton
Drew wrote: This seems to me the appropriate situation for using OUTER JOINs, but I cannot figure out how to get the null rows without the not-null rows. However, when I try to exclude the one not-null row, doing this: SELECT

Re: [SQL] How to find missing values across multiple OUTER JOINs

2007-06-06 Thread Drew
Thanks! That was it. Drew On Jun 6, 2007, at 1:45 AM, Ragnar wrote: On þri, 2007-06-05 at 23:55 -0700, Drew wrote: I'm having troubles using multiple OUTER JOINs, which I think I want to use to solve my problem. My problem is to find all non-translated string values in our translations

Re: [SQL] schema propagation

2007-06-06 Thread Markus Schiltknecht
Hi, chester c young wrote: has anyone done any work on comparing schemas? There are two different projects called 'pgdiff', you'll find them with google. I'm trying to automatically propagate changes in a master schema to child schemas. All schema changes will originate at master.

Re: [SQL] JOIN

2007-06-06 Thread Loredana Curugiu
I found my problem. I attaches an .sql file with my tables, data and my new query. If you are interested you can take a look. Thanks to all. Regards, Loredana

Re: [SQL] JOIN

2007-06-06 Thread Loredana Curugiu
I forgot the attachement :) On 6/6/07, Loredana Curugiu [EMAIL PROTECTED] wrote: I found my problem. I attaches an .sql file with my tables, data and my new query. If you are interested you can take a look. Thanks to all. Regards, Loredana CREATE TABLE reminder_services ( uid

Re: [SQL] current_date / datetime stuff

2007-06-06 Thread Osvaldo Rosario Kussama
Kristo Kaiv escreveu: oneliner: select date_trunc('month',now()) + ((8 - extract('dow' from date_trunc('month',now()))||'days')::text)::interval; There is a problem when first monday is 1st or 2nd day of month. bdteste=# SELECT date_trunc('month',meses) + ((8 - extract('dow' from

Re: [SQL] current_date / datetime stuff

2007-06-06 Thread Kristo Kaiv
true, didn't test it that thoroughly: mod 7 should be bit more beautiful select date_trunc('month',now()) + ( ((8 - extract('dow' from date_trunc('month',now()))%7) ||'days')::text)::interval; On 06.06.2007, at 18:54, Osvaldo Rosario Kussama wrote: Kristo Kaiv escreveu: oneliner: select