To help you understand SQL I should point out that your version would
work (assuming only 1 school per person) if you just left the friends
out of the FROMs for the sub-selects:-
select frienda, friendb from friends where
(select schools.school from schools as schoolsa where friends.frienda =
sc
How about:-
SELECT id
FROM (a LEFT JOIN b WHERE a.flag=b.flag)
GROUP BY id
HAVING
((COUNT(*)=COUNT(b.flag))
AND
(COUNT(*)=(SELECT COUNT(*) FROM b AS b_cnt)));
This relys on COUNT(field) not counting NULLs, and that NULL is what the
LEFT JOIN returns for an absent b.flag:-
Hi back
Carl van Tast wrote:
>
> Hi, Thurstan
>
> On Thu, 20 Sep 2001 17:30:46 +0100, "Thurstan R. McDougle"
> <[EMAIL PROTECTED]> wrote:
>
> > [...]
> >Carl van Tast had 2 good methods as follows
> >
> >SELECT userid, va
Look at his table structure, you will see a timestamp. His request can
be rephrased as "The val field from the latest record for each userid in
turn.
Carl van Tast had 2 good methods as follows
SELECT userid, val
FROM tbl
WHERE NOT EXISTS (SELECT * FROM tbl AS t2
WHERE tbl.us
"David M. Richter" wrote:
>
snip...
> Yes I have to do . Now I solved that problem with rename the original
> table study to _study
> then create the new right structured table study , Insert into study
> (chilioid,...,...) SELECT * FROM _study;
> Ok not elegant but it works.
>
> Another questio
user is an SQL reserved word, use 'user' instead.
You might like to have a look at the list of reserved words at
http://www.postgresql.org/idocs/index.php?sql-keywords-appendix.html
Jari Aalto+usenet wrote:
>
> [Please keep CC]
>
> Can anyone suggest, what is wrong with the following