We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

USE SQL query to count number of categories in a group

Development and Programming

artlab's avatar
artlab
37 posts
15 years ago
artlab's avatar artlab

So I can figure out how to count the categories that are applied to a specific entry <pre><code>{exp:query sql="SELECT COUNT(*) AS my_count FROM exp_category_posts WHERE entry_id = '{entry_id}’</code></pre>

But I want to extend this so I can count the number of categories in a specific entry that are from a particular category group so for example group_id = “6”

This should be a really simple query, but given I am SQL impaired…. help appreciated.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.