Hi all,
Having a bit of a headache trying to compare 2 tables in my MS SQL db.
Basically I have
Table 1 - dbo.teams (Contains a list of teams under field name team_NAME)
Table 2 - dbo.user-preferences (Keeps a record of Teams chosen from Table 1)
At the moment I may have
Table 1 - teams:
Column in db - team_NAME:
teamA
teamB
teamC
teamD
teamE etc...
Table 2 - user_preference s:
Column in db - prefTEAM:
teamC
teamE
What I'm trying to do is construct a select statement and condition to display a distinct list of results of all teams in Table 1 but highlight/bold any that are also in Table 2
so in the above tables example the results I would need would be...
teamA
teamB
<bold>teamC<bol d>
teamD
<bold>teamE<bol d>
Any ideas on the best way to do this?
If possible I need the condition that would highlight duplicates seperate from the select statement as rather than bold, I may change these to check or uncheck boxes on a form.
Hope it all makes sense.
Regards
Paigey
Having a bit of a headache trying to compare 2 tables in my MS SQL db.
Basically I have
Table 1 - dbo.teams (Contains a list of teams under field name team_NAME)
Table 2 - dbo.user-preferences (Keeps a record of Teams chosen from Table 1)
At the moment I may have
Table 1 - teams:
Column in db - team_NAME:
teamA
teamB
teamC
teamD
teamE etc...
Table 2 - user_preference s:
Column in db - prefTEAM:
teamC
teamE
What I'm trying to do is construct a select statement and condition to display a distinct list of results of all teams in Table 1 but highlight/bold any that are also in Table 2
so in the above tables example the results I would need would be...
teamA
teamB
<bold>teamC<bol d>
teamD
<bold>teamE<bol d>
Any ideas on the best way to do this?
If possible I need the condition that would highlight duplicates seperate from the select statement as rather than bold, I may change these to check or uncheck boxes on a form.
Hope it all makes sense.
Regards
Paigey
Comment