Group by Customer ID where Another Column is only Contains a specific set of Values -
wasn't sure how ask one.
i have table 4 columns in it. pk, customerid, language, , date. customer id can same multiple rows in file. language numerical value 1-8 representing different languages. date first of given month. so, 10 rows in table, legitimate customerid 123 10 rows, language '1' ten rows, , date '1/1/2015' 10 rows. essentially, have lot of subsets in table pk create row level distinction.
on trying do. need group customer id, 3 specific dates ('10/01/2015', '11/01/2015', '12/01/2015'), value found language 1. meaning, if on 10/01/05, customerid 123 has 10 rows , 9 language '1', , 10th row language '2', wouldn't want return in results.
at end, need list of customer id's 3 dates have '1' there language , not have other languages in rows.
this has gotten beyond skill. appreciate feel simpler making out be.
i think should trick:
select * table language = 1 , (date = date1 or date = date2 or date = date3) group customerid
Comments
Post a Comment