On Sat, Mar 1, 2008 at 6:13 PM, Gilles Ganault <[EMAIL PROTECTED]> wrote:
> On Sat, 1 Mar 2008 18:04:12 -0500, "Stephen Oberholtzer"
>  <[EMAIL PROTECTED]> wrote:
>  >>  INSERT INTO Table2 VALUES (NULL,"Some text in Table2");
>  >>  INSERT INTO Table2 VALUES (NULL,"Some other text in Table2");
>  >>  =====
>  >>  INSERT INTO Table1 VALUES (NULL,"John Doe",1);
>  >>  INSERT INTO Table1 VALUES (NULL,"JaneDoe",2);
>  >>  =====
>  >>  SELECT * FROM Table1,Table2 WHERE Table1.table2id=1;
>  >>  =====
>  >>  1|John Doe|1|1|Some text in Table2
>  >>  1|John Doe|1|2|Some other text in Table2
>  >>  =====
>  >
>
> >I'm confused. Which one of those rows does not have table1.table2id=1?
>
>  Sorry for the imprecision: It's the same record, but why do I get two
>  rows instead of one? I expected only the first one, since "Some text
>  in Table2" has its ID = 1.

Then you need to specify that:

SELECT * FROM Table1,Table2 WHERE Table1.table2id=1 AND Table2.ID=1;

I have to ask: Why is it that you expected a condition applying to one
column on one table, to also apply to a differently named column in a
differently named table?

-- 
-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to