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

  • Home
  • SEARCH
  • 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 8073901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:29:14+00:00 2026-06-05T14:29:14+00:00

Here is the problem. select count(studentID) AS count from educators where count > 1

  • 0

Here is the problem.

select count(studentID) AS count from educators where count  > 1 group by studentid  

Will not work as SQL Server does not yet know about the count column.

So I have to do this

select *
  from (select count(StudentID) as count
          from educators
         group by studentid
       ) s
 where s.count > 1

Is there a more elegant solution? It seems like there should be a much nicer way to do this.

  • 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-05T14:29:15+00:00Added an answer on June 5, 2026 at 2:29 pm

    You could use the HAVING clause, maybe something like this:

    SELECT StudentID, COUNT(StudentID)
    FROM educators
    GROUP BY StudentID
    HAVING COUNT(StudentID) > 1
    

    The query will display all StudentIDs that appear more than once.

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

Sidebar

Related Questions

Here is my problem (I'm using SQL Server) I have a table of Students
Here's the statement: NSString *sqlCmd = @SELECT COUNT (*) FROM SiteData WHERE SITE_ID =
Here is my query: SELECT count(*) FROM table_testcase_execution WHERE campaign_session_id = any(SELECT campaign_session_id FROM
here is my mysql statement: $result = mysql_query(select count(*) from usersecurity where email='.$_SESSION['username'].'); echo
Here is my code in Python: queryuniq = SELECT COUNT(distinct src_ip), COUNT(distinct video_id)FROM video
Here is my query: SELECT DISTINCT `c`.`user_id`, `c`.`created_at`, `c`.`body`, (SELECT COUNT(*) FROM profiles_comments c2
I have a problem. My DB is Oracle 9. Here is my SQL: SELECT
I have to perform the following SQL query: select answer_nbr, count(distinct user_nbr) from tpoll_answer
I have this SQL code here.. SELECT cl.clientid, cl.clientname, cl.billingdate, cp.startdate, cp.expiration, (SELECT COUNT(*)
I have a problem here. My Zend_Forms do not render in view script. Via

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.