Topic: Request about comparing of the data
There are two tables containing an INN.
In the first table of an INN it is written down in the form of number (type bigint); in the second - in the form of the text (type varchar), that is in value are available both leading zero and characters a gap and other. It is necessary to deduce in a resultant dial-up matching values (an INN which meet in both tables).
I made here such request:
select inn_1.inn from inn_1 where inn_1.inn = (select cast (inn_2.inn as bigint) from inn_2)
As a result produces an error: the Message 8114, level 16, a state 5, a line 1
Error at type conversion of the data varchar to bigint.
Prompt please where an error in request?