javascript - SQL - Check For Duplicate Values -
(this project written in js)
so, have table called paid_offers, , 2 columns called offer_id , entity_id i'm trying count of offer_id values associated single entity_id.
edit: example: entity_id has 35 offers available (so, there 35 rows unique offer_ids, same entity_id)
so, getting count no problem arraylist.length, need approach getting actual array. help!
edit: per request, more information! i'm going using output array.
so, project written using titanium (from appcelerator). don't need besides query. so, it'd what's inside quotes here, don't know.
var offerslist = db.execute("select entity_id paid_offers");
now, goal not list of id's instead list of offer_id values associated each unique entity_id value. think close to:
var offerslist = db.execute("select offer_id paid_offers entity_id = entity_id
except wouldn't work, that's train of thought while looking through this.
if you're trying count offers each entity, it's
select entity_id, count(offer_id) count paid_offers group entity_id this find entities @ least 1 offer.
Comments
Post a Comment