Re: [SQL] Help to simplify sample query

2004-03-09 Thread Bruno Wolff III
On Tue, Mar 09, 2004 at 17:13:37 -0300, Daniel Henrique Alves Lima <[EMAIL PROTECTED]> wrote: >Where can i find the documentation about "except" or "textcat" ? > I've looked at html docs in my machine (i've a 7.34 copy) and i > couldn't found information/sample of them. except should be

Re: [SQL] Help to simplify sample query

2004-03-09 Thread Daniel Henrique Alves Lima
Where can i find the documentation about "except" or "textcat" ? I've looked at html docs in my machine (i've a 7.34 copy) and i couldn't found information/sample of them. Thanks. ---(end of broadcast)--- TIP 7: do

Re: [SQL] Help to simplify sample query

2004-03-09 Thread Daniel Henrique Alves Lima
How about this: select cd_area from area a1 where not exists ((select 1,2 union select 98,45 union select 11,0) except select c2.cd_teacher,c2.cd_course from teacher_course c2 where c2.cd_course=a1.course) ? Tom Lane wrote: Daniel Henrique Alves Lima <[EMAIL PROTECTED]> writes: I

Re: [SQL] Help to simplify sample query

2004-03-09 Thread Daniel Henrique Alves Lima
Tomasz Myrta wrote: Can you try this query ? : select cd_area from area a1 join teacher_course c2 using (cd_course) where (cd_teacher,cd_course) in (select 1,2 union select 98,45 union select 11,0); Tomasz, the "in" in the query above will work like an "or" ((cd_teacher=1,cd_course=2) or (c

Re: [SQL] Help to simplify sample query

2004-03-08 Thread Tomasz Myrta
Dnia 2004-03-09 06:41, Użytkownik Daniel Henrique Alves Lima napisał: Hi guys, i have a new question about how to simplify a query. I have the tables area_course(cd_area,cd_course) and teacher_course(cd_teacher,cd_course) and a set of pairs of values {(1,2),(98,45),(11,0),...}. Now, i mus

[SQL] Help to simplify sample query

2004-03-08 Thread Daniel Henrique Alves Lima
Hi guys, i have a new question about how to simplify a query. I have the tables area_course(cd_area,cd_course) and teacher_course(cd_teacher,cd_course) and a set of pairs of values {(1,2),(98,45),(11,0),...}. Now, i must to select the areas which courses appears in teacher_course and mat