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 8349289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:56:58+00:00 2026-06-09T07:56:58+00:00

I have table like id userid semid courseid coursename total 1 36 17 13

  • 0

I have table like

id     userid  semid  courseid  coursename  total
1       36      17       13       CA         23
2       36      17       5        CB         46        
3       36      17       8        CC         20
4       36      19       16       CD         34
5       36      19       13       CA         31
6       36      19       3        CA#        29
7       36      19       7        CE         60
8       36      10       9        CK         32
9       36      10       15       CH         56    

I need average of semid for a userid i.e., SUM(courseid) /count (moduleid), It was showing 9 as module count, but I have only 3 modules.
This is my query

SELECT userid, SUM(total)/count(semid) FROM custom WHERE userid=36  
  • 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-09T07:57:00+00:00Added an answer on June 9, 2026 at 7:57 am
    SELECT userid, SUM(total)/count(distinct semid) FROM custom WHERE userid=36   
    

    Try this query

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with three columns UserID, Count, Date I'd like to be
why select 'aaa' =0 return 1 (TRUE) if i have a table like userid
In SQL Server 2008 I have a user table like the following: Userid Username
I have a table like this UserID Score Date 5 6 2010-1-1 7 8
I have UserScores Table with data like this: Id userId Score 1 1 10
I have a table like this: UserID Customer ID status 1 1 1 1
I have a table with weekly data that looks like: userID Site date ------
Lets say I have a session table like this: [Session] ------- Id: int UserId:
I have a table like the following table: UserID Num1 Num2 Code Name Cat
Given that I have a table contains user data, like this: userID calltime result

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.