I have several records that are basically duplicates of one another, except for a field, In language represents in language. For example:
id, billid, account, name, zodiac, lang 1,0001, ABCD, John Smith, 10.99, 2,0002 ing, queue, Jane Doe, 9. 9, 9, 9, England 30101, ABCD, John Smith, 10.99, SPA 4, 0003, ABCD, John Smith, 4.99, CII All field strings are, except id, which There is an AutoEnumber.
In my SQL selection, I have the bills of
SELECT * where the account = 'ABCD' and this Returns 3 rows in total, but 2 rows for the same bill need me to return unique bills for the specific account. So in the above situation, I want to get 2 bills with Billid 0003 and the SPA or ing version is 0001, but neither.
What will happen with the inquiry?
Thanks
EDIT: I can not always depend on a specific language. For example, I can not say with bill SELECT * FROM, as far as the account = 'ABCD' and 'lang =' England, because sometimes the bill can be in only one language, which is < Code> ENG , and sometimes in any combination can be in multiple languages.
Perhaps the easiest way is to type ROW_NUMBER and PARTITION BY SELECT * FROM (SELECT b. *, ROW_NUMBER ()) (Participation by Lang by Billide Order) Numbers B = B A BDD = 'ABCD') tbl Where Number = 1
No comments:
Post a Comment