How to write a select inside case statement
问题 I have a stored procedure that contains a case statement inside a select statement. select Invoice_ID, 'Unknown' as Invoice_Status, case when Invoice_Printed is null then '' else 'Y' end as Invoice_Printed, case when Invoice_DeliveryDate is null then '' else 'Y' end as Invoice_Delivered, case when Invoice_DeliveryType <> 'USPS' then '' else 'Y' end as Invoice_eDeliver, Invoice_ContactLName+', '+Invoice_ContactFName as ContactName, from dbo.Invoice left outer join dbo.fnInvoiceCurrentStatus()