0

credits is temporary table. I need to show all records along with total number of records. I am using following query.

select *,(select count(*) from credits ) as totalrecords  from credits;

Error:1137 - Can't reopen table: 'credits'

  • You're not allowed to use the same temporary table multiple times in a single query. You'll need to make a copy of the table. Or if you're using MySQL 8.0 you could use a CTE. – Barmar Apr 28 '22 at 15:56

0 Answers0