Re: [SQL] problem with subqueries

2002-10-05 Thread Stephan Szabo
On Sat, 5 Oct 2002 [EMAIL PROTECTED] wrote: > Because I want to obtain a monthly breakdown, I created a view called > monthcustomer as this select: > > select orders.ord_date, customer.cname, > date_part('month',orders.ord_date) AS "month", > date_part('year',orders.ord_date) A

Re: [SQL] problem with subqueries

2002-10-05 Thread Tom Lane
[EMAIL PROTECTED] writes: > select distinct year,month, > (select sum(monthcustomer.number_of_items) from monthcustomer where > monthcustomer.year=m.year and monthcustomer.month=m.month) as NumPots > from monthcustomer m; > This goes off and never comes back - No surpr

[SQL] problem with subqueries

2002-10-05 Thread pete
Hi Any help appreciated - I have spent 2 days trying to get this query to work! I have an orders database and a customer database. The orders database has a date field for each order. Because I want to obtain a monthly breakdown, I created a view called monthcustomer as this select:

Re: [SQL] enforcing with unique indexes..

2002-10-05 Thread dev
> > ie i want 1 to 1 mapping between group_id and userid so that , there > shud not be a single group_id having more that one kind of userid. > > can it be done with some sort of UNIQUE INDEX? If you want multiple groups but the user should always be the same 1 1 ok 1 1 ok 2 1 ok 3 2 ok