In Oracle, if I needed to declare something with the same type as another column, I can simply use %type
:
Create table foo(
copiedType OTHER_TABLE.COLUMN_NAME%TYPE
/* yada yada yada... */
Is there an equivalent operator in MySQL?
Well, the short answer, as it turns out is "no", and while it can be faked if you're willing to create a stored function (or use another language) and create your table by your own custom baked parsing engine, it simply isn't worth it. C'est sera...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With