Consult SQL statements or stored procedures

has two columns of data: all is the cumulative total amount of prizes issued, and use is the amount used
id all use
11500
220000
320000
420000
520000
6500
written with sqlserver sql sentence. One record is extracted from these six pieces of data, and the selected records need to be selected in proportion to the number of prizes issued. In other words, each prize appears at random, but it can guarantee how many times the prize will be produced every other time. It is not possible to give out all the prizes with small circulation in the early stage, but all the prizes can appear equally and not centrally.

< hr >

like the table above, there are a total of 1000 prizes, such as 6, which appears about every 20 times, as well as several other awards, probably in this range.

Nov.04,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3748a-2c09a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3748a-2c09a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?