Hassle-free live chat software re-imagined for business growth. 2 users, always free.
UPDATE IC SET IC.InvoiceSiteID = (CASE WHEN IC.SiteID IN(SELECT InvoiceToSite FROM QuoteInvoicing WHERE QuoteID = IC.QuoteID) THEN InvoiceToSite ELSE MIN(InvoiceToSite) FROM QuoteInvoicing WHERE QuoteID = IC.QuoteID AND InvoiceToSite <> IC.SiteID END) FROM #InvoiceConsolidation IC INNER JOIN QuoteInvoicing IQ ON IC.QuoteID = IQ.QuoteID
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!