I'm trying to partition my table using the ID column such that all even ID's should go in partition_1 and odd ID's should go in partition_2. The only closest thing that met my needs was virtual columns
.
CREATE TABLE sales
(
id NUMBER(6) NOT NULL,
mod_id AS (MOD(id, 2))
);
PARTITION BY RANGE (mod_id)
(
PARTITION mod_id VALUES LESS THAN(1),
PARTITION mod_id VALUES LESS THAN(2),
)
Is there a better way than this?