Skip to content
Advertisement

Tag: count

How to count multiple columns in SQL (Oracle) with criteria?

I’m working on SMS-Gateway that holds multiple charged SMS-services with different numbers, each SMS sent to the customer has 4 status as below (forwarded, delivered, expired,delivery failed) Now I have the below first_table for the charging-system with the below details (TABLE-A) and below (TABLE-B) which contain the status of each sent SMS with its ID Below is my expected final

MySQL: Counting active products that belong to active categories (and optionally to active subcategories)

i’m using MySQL 5.6. I need to get a list of categories, with a product count column. So far, a very easy and trivial task. Here’s where it gets a little complicated: A product has a category, and can also have a subcategory (optionally). Categories, subcategories and products can be active (flg_public=1) or disabled (flg_public=NULL). So, the query should return

How to COUNT “accounts” only if character/user exist

I have 2 tables – “accounts” and “players” I’m using this query to COUNT accounts Accounts table estructure: Players table estructure: * Let’s say the query counts 10 accounts but only 3 accounts have a character/user created. I would like to know how to count only those 3 accounts without taking in consideration how many characters/users has the account, so

Advertisement