Sql query statement

A table with transaction numbers, borrowers, lenders, and the amount of money borrowed. A person can borrow money from multiple people, or lend money to multiple people. The need is to display a table to the front desk. The horizontal title of this table is borrowed money, the column is introduced to the person, the middle is the amount of each transaction, and the total amount of statistics

Sql
Apr.02,2021

the data structure in the database is very clear. The problem that does not need to be solved by sql at all is how to show it at the front end

a -> b  1000
b -> c  550
a -> d  200
a -> e  300
c -> f  300
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-1b3bfc7-4131b.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-1b3bfc7-4131b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?