Hi,

select a.ID
   from a
   join b on b.aID = a.ID
  where b.user = 'MyUser'

The join is an inner join, so that only rowa of table a are selected 
where a rocord in b exists. This seems to be what you want.

Martin

Am 21.01.2011 12:33, schrieb Ian Hardingham:
> Hey guys.
>
> This is just an utterly simple question I know, but I still haven't got
> my head around it.  I have two tables:
>
> Table A
> int ID
>
> Table B
> int user
> int aID
>
> I need a query which selects all elements of Table A which are "owned"
> by a specific user, ie for which there is an entry with user, id in Table B.
>
> Thanks,
> Ian
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to