+ Reply to Thread
Results 1 to 2 of 2

Thread: Count data on database

  1. #1

    Count data on database

    Hi , i`d like to count the number of data on a certain column , can you give me an example ?

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    20
    If it's a varchar type, this will tell you the number of bytes used by the column:
    Code:
    select sum(length(columnName)) + count(*) as totalBytes from tableName;
    For varchar, you add 1 byte per row (ie add count(*)).


    If it's char, simply multiply count(*) by the column width.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts