Practical problems of Mysql

demand:
1. I have a table recording the contents of the article (N items)
2. Now you need to add his click scale in batch (empty)
3. Now we need to generate the primary key ID of the click table and how to manipulate some data according to some fields of each article.
what I want to do is to write a function

.
begin
select 
insert 
end

problem: give an example of how to write the solution.

Sep.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-1b3ed2a-2b7a9.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-1b3ed2a-2b7a9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?