List:General Discussion« Previous MessageNext Message »
From:Michael Caplan Date:August 5 2006 10:28am
Subject:Limiting a Join
View as plain text  
Hi there,

I'm following up on a thread I started yesterday with a new thread, 
cause I'm now looking at  a different problem: limiting the result of a 
join.  For example:

SELECT
   *
FROM
   a
JOIN
   b
ON
   a.id = b.id

If I wanted all records from "a" and only the first record from "b", how 
would I integrate a LIMIT statement in this, or some other statement 
that would achieve the same end?  Appending LIMIT to the end of the 
query will limit the entire result set, which is not the desired effect.

Any ideas?

Thanks,

Michael
Thread
Limiting a JoinMichael Caplan5 Aug
  • Re: Limiting a JoinPeter Brawley5 Aug
    • Re: Limiting a JoinMichael Caplan5 Aug
      • Re: Limiting a JoinPeter Brawley5 Aug