To store a temporary result set you can use a special type of table i.e. called MySQL temporary table. To keep temporary data, the temporary tables could be very useful in some cases. When the current client session terminates, the temporary tables is deleted.
This is useful for stored procedures, join query etc. Temporary tables were added in MySQL version 3.23.
CREATE TEMPORARY TABLE temp_user SELECT * FROM user u INNER JOIN result r ON u.user_id = r.user_id GROUP BY u.user_id;
Read Also: MySQL GROUP_CONCAT() maximum length
Now you can query data from temp_user table by following query:
SELECT * FROM temp_user;
After completing the functionality you can delete the temporary table using:
DROP TEMPORARY TABLE temp_user;
Why Maintenance Feels Overwhelming Most homeowners know they should maintain their roof, but many avoid…
Being involved in a car accident, whether it’s a minor or major collision can be…
Have you or your loved one been involved in a truck accident? Dealing with a…
Divorce is a serious decision that many families, unfortunately, face on a daily basis. It…
For anyone trying to grow an online presence, interaction is just as important as publishing…
In today's competitive academic world, students are constantly juggling multiple responsibilities, from preparing for exams…