1

I have a table with 2 columns, user and userMessage with table name as Messages I have another table with 2 columns as user and userMessageCount with table name as MessageCount. I am very new to programming. I need to write an update query or procedure something that will count the number of messages per user from Messages and store the count in MessageCount.

I am not able to understand the proper way of doing this. I understand this is a very basic question and I should study to solve this. i am running very late for a deadline. Please help me on this query.

2

1 Answer 1

3
Insert Into MessageCount 
Select user, count(*)
From Messages
Group by user
Sign up to request clarification or add additional context in comments.

1 Comment

Exact answer. You understood me perfectly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.