Could this be the correct SQL second part in the UNION?

SELECT DISTINCT Ad1.Identifier
FROM Groups
INNER JOIN Users_Groups_Link
ON Users_Groups_Link.FK_Groups = Groups.PK_ID
INNER JOIN Adverts Ad2
ON Ad2.FK_Users = Users_Groups_Link.FK_Users
INNER JOIN Advert_Fields
ON Advert_Fields.FK_Adverts = Ad2.PK_ID
AND Advert_Fields.Data LIKE '%' + @data + '%'
INNER JOIN Adverts Ad1
ON Ad1.PK_ID = Advert_Fields.FK_Adverts
WHERE Groups.Administrator = (SELECT Users.Forename FROM Users WHERE
Users.uID = @userid)


I think I'm doing the relations from Groups down to Adverts - Ad2, then
I think I'm relating from Ad2 to AdvertFields, doing the extra query and
relating back to Adverts - Ad1?

Is this ok? Does it make sense to do that?
I think I'm going mad, this is messing with parts of my head that shouldn't
be touched.

Still not sure if I've got it? Tea break...


Cheers,
Nick


---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to