Re: SQL Problem
Posted in 1997
} }>Try: } }> select a.column } }> from table a, outer abc b } }> where a.col_name != b.col_name; } }>Notice the 'outer'. } }>This says that if you don't find a row in table b select the row } }>from } }>table a anyway. } } Thanks for the solution. } But my question is then what does the column in the table abc contain } when the table is created, if not NULL or space. (Refer below) When the table is created, there are no rows, so nothing is contained within table abc. As I understand your original message (below), you did not insert anything into table abc. Because there were no rows in that table, the OUTER clause is required. } } } } } } } } Hi folks, } } } } There is a small sql problem I faced. } } } } I created a table with one column } } create table abc } } ( } } col_name varchar(8) NOT NULL } } ); } } } } After this I didn't do any kind of transaction against this table. } } So, my next sql statement was } } select a.column } } from table a, abc b } } where a.col_name != b.col_name; } } } } This didn't give any result. } } So i changed this to : } } select a.column } } from table a, abc b } } where a.col_name = b.col_name; } } And Lo!! no results....!!!!!!! } } Finally i inserted a space in the table abc. } } And both the sql's started working. } } } } } } ANY COMMENTS.... } } } } REgards } } } } Praveen } } Sunnyvale, CA } } e-mail praveen_mohanan@hotmail.com } } tel no : 650.594.9899 X 217 } } Mark Collins mcollins@us.dhl.com The problem lies in how easily and dangerously we forget that manipulating things is not the same as understanding them.