How to determine the size of a table one row?

I like to know how to calculate the size of one row of a table.

Consider my table has entries below.

Empid Ename Age    DOB      Salary
10000 BalaS 26  12-03-2015  123456
+4
source share
3 answers

This should solve your problem. Use the length () operator as shown below. This will give the exact character length in the specified column. This will also take NULL values ​​into account , NULL will be evaluated to 0 :

select length(Empid || Ename || Age || DOB || Salary)
from mytable 
where id = someId;
+3
source

You can try the following:

select vsize(Empid) + vsize(Ename) + vsize(Age) + vsize(DOB) + vsize(Salary)
from mytable 
where id = someId;
+2
source

, vsize ().

sql VSIZE ()

0

Source: https://habr.com/ru/post/1621402/


All Articles