Re-write query to use only one bo_custom.dbo.Property_Coorindators

  • Hi All,

    Please I need help to re-write this to use one Property_coorindators table

    SELECT [Case Name], [Case Number], [Case Type], [Lead Fee Earner], Office

    FROM [BO_Custom.dbo.Property_Coordinators_Summary]

    WHERE Office IN

    (SELECT o.offc_desc

    FROM bo_custom.dbo.Property_Coorindators p

    INNER JOIN hbl_office o ON o.offc_code = p.offc_code

    WHERE employee_uno IN

    (SELECT employee_uno

    FROM bo_custom.dbo.Property_Coorindators))

    Thanks

  • based on the name, [BO_Custom.dbo.Property_Coordinators_Summary] appears to be a view, which probably is a GROUP BY on the Property_Coorindators anyway.

    you know your data much better than we do, especially why you want to select only from the table(there's a reason, right?

    substitute the ACTUAL view definition for [BO_Custom.dbo.Property_Coordinators_Summary] and modify it form there, i guess

    SELECT

    [Case Name],

    [Case Number],

    [Case Type],

    [Lead Fee Earner],

    Office

    FROM (SELECT ColumnList FROM.....) AS [BO_Custom.dbo.Property_Coordinators_Summary]

    WHERE Office IN (SELECT

    o.offc_desc

    FROM bo_custom.dbo.Property_Coorindators p

    INNER JOIN hbl_office o

    ON o.offc_code = p.offc_code

    WHERE employee_uno IN (SELECT

    employee_uno

    FROM bo_custom.dbo.Property_Coorindators))

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply