December 9, 2013 at 2:45 am
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
December 9, 2013 at 6:22 am
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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply