smithesh
smithesh

Reputation: 1

mysql inner join two tables with int and enum data type

How to join two table table with different data types? in the first table status field type is enum and in second table it is int, how i can join these tables

Upvotes: 0

Views: 1480

Answers (1)

Packet Tracer
Packet Tracer

Reputation: 3924

Enum type is stored by MySQL as an int, so you can do the join as usual. But in case both fields were different you should cast one of them to make their types match if possible (usually with cast functions http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html)

Upvotes: 1

Related Questions