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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:01:06+00:00 2026-06-16T14:01:06+00:00

Following is my sql query in which i am trying to get the names

  • 0

Following is my sql query in which i am trying to get the names of those people whose address is same but the problem i faced is that the query is showing the right count but all the names are not there grouped by and not in the following manner. Kindly let me know how can i modify the following query so i can get the address in a manner mentioned below and also count(address) = 1 should be ignored. Thanks,

+---------------------+
 Jhon  | Stree 9, H#4
 zame  | Stree 9, H#4
 sinn  | Stree 9, H#4
 linn  | Stree 8, H#9
 tinn  | Stree 8, H#9
+---------------------+
SELECT *,count(address) FROM `student` 
group by address
order by  count(address) desc

SQLFIDDLE: http://sqlfiddle.com/#!2/6d6ca/2

  • 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-16T14:01:07+00:00Added an answer on June 16, 2026 at 2:01 pm

    Try this:

     SELECT name, count(address) FROM student 
     GROUP BY address 
     ORDER BY count(address), name DESC
    

    EDIT:
    do you mean this group_concat ?

       SELECT GROUP_CONCAT(DISTINCT name ORDER BY name DESC SEPARATOR ' ')as name, 
        adress FROM student 
       GROUP BY adress 
      ORDER BY count(adress), name DESC
    

    DEMO HERE

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

Sidebar

Related Questions

Following is my query in which I am trying to insert those records whose
Following is my sql query for cron in which i am trying to save
I have following somewhat complex sql query which has horrible performance, 'certainly' due to
I have a drop-down list which is generated based on the following sql query:
I have the following which works in SQL Query Analyzer . select oh.* from
I currently have the following SQL query that lists all the names of all
I am trying to write a query in yii. I have the following which
I have the following SQL query which populates a table with details of various
I am trying to write an SQL (Server) query which will return all events
I'm trying to write a sql query to the following (from this site http://sqlzoo.net/1b.htm

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.