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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:32:43+00:00 2026-05-23T09:32:43+00:00

I am doing a pretty normal routine, but having a tough time getting my

  • 0

I am doing a pretty normal routine, but having a tough time getting my output correct.

I have two tables: *ads_list* (listings) and *ads_cate* (categories).

I am currently displaying my category list like so:

SELECT id, cateName FROM ads_cate ORDER BY cateName

What I am trying to achieve: count of all items in each category in this format:

Category | Number of Ads

categoryName 56

This is my current code, and have been tweaking but getting no output in my array:

SELECT 

ads_cate.id, 
ads_cate.cateName, // Category Name

ads_list.id, 
ads_list.COUNT(title), // Title of ad
ads_list.Category // Relational Category ID INT(11)

FROM

ads_cate, 
ads_list

GROUP BY cateName 
ORDER BY cateName

I am calling in all required fields and running a COUNT() on my title field (as these are unique for each ad) and then I am grouping by cateName which also seems correct.

  • 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-23T09:32:43+00:00Added an answer on May 23, 2026 at 9:32 am

    See what this gives you. I think it is what you need.

    SELECT 
    ads_cate.cateName, // Category Name
    COUNT(ads_list.id), // Title of ad
    FROM
    
    ads_cate
    INNER JOIN 
    ads_list
    ON ads_cate.id = ads_list.category
    
    GROUP BY cateName 
    ORDER BY cateName
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been doing some research on test driven development and find it pretty
I'm in a project where it's pretty much my first time doing all the
I'm doing pretty simple thing here: getting Facebook news feed using their graph API.
I have a pretty normal setInterval call (I think): var myInterval = setInterval(myFunction('passVar1', 'passedVar2'),
I have a pretty simple thing I'm doing with javascript and basically only sometimes
I'm doing a pretty simple validation that checks if two fields are equal. Unfortunately,
This may be a bit silly question, but I just started doing pretty things
I'm developing a Mahjong-solitaire solver and so far, I'm doing pretty good. However, it
( Note : I'm using Scala 2.7.7 here, not 2.8). I'm doing something pretty
Doing odd/even styling with jQuery is pretty easy: $(function() { $(.oddeven tbody tr:odd).addClass(odd); $(.oddeven

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.