View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 09:35 AM
Sanders Kaufman
 
Posts: n/a
Default Re: should I use join?

mcardeiro@yahoo.com wrote:
> Hi
>
> I am stumped on a select statement. basically I have 2 tables I want
> to use in my select
>
> table1 = "uploads" has fields 'id', 'size'
>
> table 2 = "uploadOwners" has field 'id' which is a foreign key
> referencing uploads.id, and field 'owner'
>
> "uploads"
> +-----+------------+
> | id | size |
> +-----+------------+
> | 1 | 653636 |
> | 2 | 45674 |
> | 3 | 5678 |
> +-----+------------+
>
>
> "uploadsOwners"
> +-----+------------+
> | id | owner |
> +-----+------------+
> | 1 | bill |
> | 2 | john |
> | 3 | john |
> +-----+------------+
>
> basically, I only want to select entries from "uploads" that are
> referenced to uploadOwners.owner="john"


You might not want a join per se (that requires some
ForeignKey Kung-fu) - but rather a compound select.
Reply With Quote