Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the size of an individual row

Status
Not open for further replies.

0ddball

Technical User
Nov 6, 2003
208
GB
Hi hi hi,

I'm trying to do something that should look like the following:

Code:
SELECT SIZE() FROM `companies` WHERE `companyId` = ?guid

It's an odd request but there *is* a point. I'm trying to find which tuple has the most data in it as an arbitrary method of choosing a destination for merging non-unique records.


Yet another unchecked rambling brought to you by:
Oddball
 
select char_length(col3)
+char_length(col7)
+char_length(col9)
/* repeat for all char/varchar/text columns */
+ 4 * 11 /* number of integer columns */
+ 2 * 3 /* number of smallint columns */
+ 1 * 6 /* number of tinyint columns */
from ...

get the idea?


r937.com | rudy.ca
 
Gosh - that's rubbish isn't it :)

Surely there's a better way?


Yet another unchecked rambling brought to you by:
Oddball
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top