Answer the question
In order to leave comments, you need to log in
How to output data from one table for each row to another?
The table is arranged as follows:
Id ║ UserId ║ UserName ║ UserDateAdded
the values from it are displayed in this way:
description = '\n'.join(' ║ '.join(f'{val}' for val in row)
for row in cursor.execute("SELECT * FROM Table"))
+ cursor.execute(f"SELECT COUNT(UserId1) FROM Table2 WHERE UserId1 = {UserId}")
Answer the question
In order to leave comments, you need to log in
select user_id, count(*) from table1 inner join table2 using (user_id) group by user_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question