Nested SELECT HELP....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Grigore Marinescu

    Nested SELECT HELP....

    Hi all,
    I have the following databasedesign :



    which i have a nested SELECT on but i need some more information which i
    don't know how to retrieve. I have the following SELECT :

    SELECT DISTINCT Resource.Resour ceID, Localized.Resou rceValue,
    Localized.Font, Resource.Resour ceName, Resource.Commen t, Type.TypeName FROM
    Localized, Resource,Type WHERE Localized.Resou rceID = Resource.Resour ceID
    AND Resource.TypeID = Type.TypeID ORDER BY Resource.Resour ceID

    For some Resources there are Rules. I will like to have a new column named
    RulesText in my query where there will be shown the RuleText if there is any
    for that particular Resource.

    Could anybody help me here ????

    Best Regards
    Mihai Marinescu


  • David Portas

    #2
    Re: Nested SELECT HELP....

    SELECT DISTINCT
    R.ResourceID, L.ResourceValue , L.Font, R.ResourceName, R.Comment,
    T.TypeName, RL.RuleText
    FROM Localized AS L
    JOIN Resource AS R ON L.ResourceID = R.ResourceID
    JOIN Type AS T ON R.TypeID = T.TypeID
    LEFT JOIN ResourceRule AS RR ON RR.resourceid = R.resourceid
    LEFT JOIN Rules AS RL ON RL.ruleid = RR.ruleid
    ORDER BY R.ResourceID

    (untested)

    --
    David Portas
    ------------
    Please reply only to the newsgroup
    --


    Comment

    Working...