I have a source table Articles with 1000 records for furniture articles. Below are the records for each category.
Beds 150
Sofa 350
Chairs 250
Tables 250
I want to select 25 articles from each category every day and load the 100 articles into a Destination table and at the end of 10 days, all the articles will be available in the destination table. After few days of executions, there is no bed left to select from source table. In that case, it should give priority to Sofa and if sofa is finished then chairs and tables. Can anyone give me an idea of achieving it in SQL query? Thanks
question from:
https://stackoverflow.com/questions/66061909/dynamic-query-to-load-a-table-based-on-assigned-weightage 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…