I want to create a temporary table for the user result and the user_id variable, but if several users use the database, the table and variable will be recreated. How can I isolate database usage for multiple users? I heard about connections, but based on the fact that there are only 150 connections by default, I thought they were for other purposes. I also heard about transactions, but I have nothing to roll back, so maybe this tool is not for me. I also do not want to add different "id" for the variable "user_id" because it is confusing What should I use?
Short example:
def create connection(user_id):
cursor.execute('SET @user_id = %s' ,(user_id,))
cursor.execute('CREATE TEMPORARY TABLE user_resulte AS (SELECT column FROM results WHERE column = @user_id)')
p.s. I'm a novice in databases :)
COUNT()
, that I need may be applied only to table, but this is wrong, I also can use theAS
keyword :)