i have a table 'product' with column 'category' which consists of 10 different categories without a column category_id. i want to derive a table with new column category_id for each category.
select product_id,description,category, round(rand(10)) as category_id from product;
select product_id,description,category, rand( over partition by 10) from product;
using above query i have tried "round(rand())" however this gives only 0 and 1, but i want it to allocate category_id for 10 products from 1 to 10.
Also i want to retrieve the products from two random category