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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:58:03+00:00 2026-06-07T03:58:03+00:00

(This project is all written in JS) So, I have a table called paid_offers

  • 0

(This project is all written in JS)

So, I have a table called paid_offers, and two columns called offer_id and entity_id
What I’m trying to do is get a count of all the offer_id values associated with a single entity_id.

EDIT: Example: entity_id A has 35 offers available (so, there are 35 rows with unique offer_ids, but all the same entity_id)

So, getting the count is no problem with arrayList.length, but I just need an approach to getting the actual array. Thanks for the help!

EDIT: As per request, more information! I’m going to be using the output as an array.

So, this project is written using Titanium (From appcelerator). I don’t need anything besides the query. So, It’d be what’s inside the quotes here, for those who don’t know.

var offersList = db.execute("SELECT entity_id FROM paid_offers");

Now, the goal is not to just get the list of ID’s but instead the list of offer_id values associated with each unique entity_id value. I would think it would look close to:

var offersList = db.execute("SELECT offer_id FROM paid_offers WHERE entity_id = entity_id

Except that wouldn’t work, but that’s my train of thought while looking through this.

  • 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-07T03:58:03+00:00Added an answer on June 7, 2026 at 3:58 am

    If you’re trying to count the offers for each entity, it’s

    SELECT entity_id, COUNT(offer_id) As Count
    FROM   paid_offers
    GROUP BY entity_id
    

    This will only find entities with at least one offer.

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

Sidebar

Related Questions

I have written a Maven plugin abstractor, called maven-base-plugin. This plugin goes over all
I have searched all over the web with no luck of making this project
In my project I have to do some repository setup before all tests. This
On the Spring-based web app project I'm on now, the developers have written two
I have written a JPA-Project which encapsulates all my entities. Since these entities are
I all, I just follow this great example: http://qt-project.org/doc/qt-4.8/tools-customcompleter.html I copy the code exactly
I have added this fix https://gist.github.com/2382288 for protect all fields against mass assignment in
I have string like this: G:\Projects\TestApp\TestWeb\Files\Upload\file.jpg How can I remove all text before Files
I have this Project model: class Project < ActiveRecord::Base validates :status, :inclusion => {
I have been handed this project that has a large number of issues with

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.