I want to take random sample by id
(not by data points) from Oracle database. My code is shown below but it failed.
select C.* from original_table C,
(select * from (select id from original_table group by id) as A
ORDER BY RAND() LIMIT 500) as B where C.id = B.id;
error message is ORA-00907:missing right parenthesis, highlighting the "as"s and the parenthesis "(select * " and "LIMIT 500) ".