"Gilles Ganault" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> I have two tables: Table1 has about 10 columns, Table2 has 2. I need
> to get all the columns of Table1 and only one column in Table2 where
> some field in Table1 is equal to field1 in Table2.
>
> This doesn't work as intended, because it returns all the rows,
> effectively ignoring the WHERE part:
>
> SELECT * FROM table1,table2 WHERE table1_field10=table2_field1;

What do you mean, all the rows? Are you saying the resultset contains 
some rows where table1_field10 is not equal to table2_field1? With all 
due respect, I find it very hard to believe.

> => Is there a smarter way to solve the problem than replacing "*" with
> every single column, ie.

Realize that the list of columns in the SELECT clause has no effect on 
the number of rows in the resultset. It only limits how much of each row 
you can see. If you feel there are rows in the resultset that shouln't 
be there, changing the column list won't help you solve that.

Igor Tandetnik 



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

Reply via email to