Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7790577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:37:39+00:00 2026-06-01T21:37:39+00:00

in my database one table is there with say name as tableA.the structure of

  • 0

in my database one table is there with say name as tableA.the structure of table is given here

id      from     message
1       23       hi how are you
2       65       hey whats going on
3       74       enjoying the vacation with family
4       23       here in Australia its chilly season
5       74       hey sam whats the plan for tomorrow

see id is auto-increment.from column says which user is sending message and the message column consists of messages . i want to know which users has sent how many words .so i have to first count the words from row then i have to search the entire column and find where there is repetiotion and add the words for that particular user.in my example you can see that two places from 23 and 74 is coming. i want my output as

    from       nos
    23         10
    65         4 
    74         12

here you can see that 23 is coming in two rows so i have added the no of words of two rows like that 74 is also coming in two rows .please guide

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:37:41+00:00Added an answer on June 1, 2026 at 9:37 pm

    You can count words by this query-

    Select length('string')-length(replace('string',' ',''))+1;
    

    For your table you can do it as

    Select *,(length(message)-length(replace(message,' ',''))+1) from table_name
    

    This will display word count of every msg in fron of it.

    For your desired result, try this-

    Select `from`, sum((length(message)-length(replace(message,' ',''))+1)) as nos from table_name group by `from`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table named 'student' in which there is one column named
One doubt in MSSQL. There are two tables in a databases. Table 1 named
I have a database with one table, like so: UserID (int), MovieID (int), Rating
I have loaded my database with one table under Data Connections in the Server
I have a SQL Mobile database with one table. It has several columns with
I have one database table which contains 8 columns. One of the columns is
I have one database table TABLE_TIPS with two value 1. tips_id (auto increment) 2.
I have a ms access database that has one table for each photo album
I have made a dump of my database in which one table is pretty
Here's a tricky one - how do I programatically create and interrogate a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.