Can you compare varchar field one of table and char field of another table ?
Asked
Active
Viewed 97 times
-3
-
2Nope, it's forbidden by law and you might get prosecuted if you try it at your home. Be careful! – N.B. Jun 23 '17 at 21:29
-
Specific details might help your cause. Right now you have a vague question that may be answered with "sure" but I doubt that would help you much less anyone else either. What is your use case? Are the tables on the same DB? When you say compare, what do you mean? Check for equality what? – scrappedcola Jun 23 '17 at 21:29
-
https://stackoverflow.com/questions/44728815/left-outer-join-getting-me-nulls-on-right-table-when-there-are-records/44729578#44729578 – jac Jun 24 '17 at 03:43
-
Please take a look at my question, I have left outer join on varchar field = char field. I am getting (null)values from the right table when there are actually records in it – jac Jun 24 '17 at 03:44
1 Answers
0
yes you can it.
first table have;
VARCHAR_COLUMN varchar(10)
second table have;
CHAR_COLUMN char(10)
you can use;
CHAR_COLUMN = VARCHAR_COLUMN
or convert;
Convert(varchar(10), CHAR_COLUMN) = VARCHAR_COLUMN

VolkanCetinkaya
- 645
- 7
- 13