Andrew Lindsay
Member
I have two tables: acct_badge_lookup and account_badge
I want to pull two fields from acct_badge_lookup: acct_badge_id and account_id
I want to pull three fields from account_badge: account_badge_id, badge_id, badge_status_id
I want to return only the records where the acct_badge_id = account_badge_id, but only when it appears in more than one account_id, and the badge_status_id equals 1 or 2.
I need just the pure SQL. Any help would be appreciated. I've looked at Unions, sub-queries, and joins, but I'm don't know how to accomplish what I'm needing.
Thanks in advance,
Andrew
I want to pull two fields from acct_badge_lookup: acct_badge_id and account_id
I want to pull three fields from account_badge: account_badge_id, badge_id, badge_status_id
I want to return only the records where the acct_badge_id = account_badge_id, but only when it appears in more than one account_id, and the badge_status_id equals 1 or 2.
I need just the pure SQL. Any help would be appreciated. I've looked at Unions, sub-queries, and joins, but I'm don't know how to accomplish what I'm needing.
Thanks in advance,
Andrew