I have 2 Tables A and B
Table A :
Id, Status
1, 1
2, 0
3, 0
4, 1
Table B :
num, text
1, some text
2, more text
3, even more text
..
..
100
I want a script that will allocate from Table B 5 records for every ID in Table A which has status of 1
so ID 1 should see num 1-5 of Table B ;
IDs2,3on't see anything and ID 4 would see num 6-10 of Table B