I hava two tables registed_products and unregisted_products. Both have autoincrement primary key which can be overlapping which if 100 id exist reg table, it can exist in unreg table as well. Insert can come from many places with in the application
There is third service expecting unique id for both type of products.
In oracle , I could have introduced one more column in each table. Create a sequence. Now could create the trigger before_insert on both the tables so that whenever there is an insert in any table, trigerr will get the next_val from sequence and insert in to new column. This way I can ensure unique number across table columns.
I am not sure how to achieve the same in mysql as there are triggers but not sequences that can be used across tables ?