开发者

Oracle/SQL - Split list into 3 segments

I'm wondering how I would go about writing a query to split a table into 3 segments. When I'v开发者_如何学JAVAe had to split a table into 2 before I've always based it off the rownum and doing a mod on it. I know I could again use rownum and select based on ranges, but if the list varies in record count each time the queries are run they will have to be updated.

Any thoughts?


Why can't you continue to use MOD, as in MOD(rownum, 3) = 0, 1 or 2? If it worked for 2, why not 3?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜