Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find the size of image in sql table?

i have an employee table and there is a column for photo.

1 )Can i check the total size of the column for all images ? 2) How to find the size of each employees pic size ?

Regards

like image 395
Bodhi Avatar asked Jan 19 '26 02:01

Bodhi


1 Answers

You can use the below code for finding the the size of the employees pic

SELECT DATALENGTH(imagecol) FROM employee group employeeID

for finding the total size you can go for sum

SELECT SUM(DATALENGTH(imagecol)) FROM  employee 
like image 102
Rohit Gupta Avatar answered Jan 20 '26 19:01

Rohit Gupta