I have the following query producing a recordset drawn from 2 tables.
SELECT
*
FROM
dbo.[qry_HorsesANDRidersAssociations]
Group By ClientID, HorseID, HorseName
UNION ALL
SELECT * FROM
dbo.[qry_HorsesRidersHaveCompeted]
Group BY ClientID, HorseID, HorseName
It produces a list of horses that a rider "wants" to have associated on their account and also a list of horses they have actually ridden.
I have been asked for a facility to hide horses from a riders account - which is more applicable to the ones they have actually ridden rather than associated (as they can easily remove this association)
A new table tblHideHorse has been created with HorseID and ClientID along with HorseHideID (identity)
How can I combine this into the above query to produce the list minus the horses they select to not show?
I know it is something along the lines of
where clientid not in (select ClientID from tblHideHorse) but im afraid that is the limit of my knowledge.
Thanks in advance
MSSQL server 2014
Our community of experts have been thoroughly vetted for their expertise and industry experience.
This award recognizes a member of Experts Exchange who has made outstanding contributions to the community within their first year as an expert. The Rookie of the Year is awarded to a new expert who has the highest number of quality contributions.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.