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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:09:49+00:00 2026-05-23T10:09:49+00:00

I have written the following query: select *, count(pk_id) as row_count from employee group

  • 0

I have written the following query:

select 
    *, 
    count(pk_id) as row_count
from employee 
group by 
    pk_id

But I am not getting 1 as the row_count value for every column.
How can I get the total number of rows returned as the result of the query?
Can someone please help?

And one more thing is I don’t want to write any subquery 🙁

  • 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-05-23T10:09:50+00:00Added an answer on May 23, 2026 at 10:09 am

    Have you considered either just counting the rows as you receive them in whatever’s consuming this result set, or just using FOUND_ROWS? Is there some reason you need the rowcount to appear as a column in the result set?

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

Sidebar

Related Questions

I have written the following query. select distinct(table3.*), (select count(*) from table2 where table2.cus_id
I have written the following query: SELECT CLIENT.CLIENTNO, CLIENT.CNAME, TOTALS.TOTAL FROM CLIENT, (SELECT CLIENTNO,
I have written the following code. But it is removing only &nbsp; not <br>
I have the following Query: SELECT * FROM tbl_Muffins WHERE OvenLoadId IN ( SELECT
I have following query written in HQL for Hibernate. ======================================================================== select new map(ret.retailerDesc as
I have written the following query using the Aggregate function SUM. SELECT D.PODetailID, SUM(D.AcceptedQty)
I have written the select fallowing query but it is giving different results surprisingly
I have the following query sql query: select * from Articles ar left join
I have the following MySql query: select t1.* from Table1 t1 inner join Table2
I have written the following query, but in the WHERE clause I have used

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.