[Q] A simple SQL query, then why #$@&*%
Posted in 1995
I have a query that does a simple join, like
SELECT e.lname, e.fname, v.vendor, v.empno, e.empno
FROM employees e, visitors v
WHERE e.empno = v.empno
NO rows are returned.
If I change the WHERE CLAUSE to
WHERE e.fname=v.fname or e.lname=v.lname
I get the desired results. Now, data exists, both columns are CHAR, fname
and empno are CHAR(25) and CHAR(10). They are both non-indexed and allow
null vlaues. The only difference is that fname is first names and empno
is social security number.
I know that my queries don't work if
WHERE empno="600987653", but works for
WHERE empno=600987653
Am I missing a simple SYNTAX. If they are both CHAR columns it should
work. Call me stupid but please reply if you have any idea ;-)
Thanks in advance.
--
Saqib Mausoof
--------------------------------------------------------------------
I have a hard enough time speaking for myself, so speaking on behalf
of my employer is out of the question.