
CREATE VIEW [dbo].[SPICE_Reference_VIEW]
AS
SELECT     dbo.RefDetail.RefDetailId, dbo.Reference.RefId, dbo.Reference.RefCache, dbo.f_species2000_getNomRefTitle(RefId) 
                      AS Title, 'Author' = CASE WHEN dbo.Reference.RefAuthorString IS NULL 
                      THEN dbo.AuthorTeam.AuthorTeamCache ELSE dbo.Reference.RefAuthorString END, dbo.Reference.RefYear, dbo.RefDetail.Details
FROM         dbo.Reference LEFT JOIN
                      dbo.RefDetail ON dbo.Reference.RefId = dbo.RefDetail.RefFk left JOIN
                      dbo.AuthorTeam ON dbo.Reference.NomAuthorTeamFk = dbo.AuthorTeam.AuthorTeamId






GO
