UPDATE table SET col1 = a.col1, col2=a.col2 FROM anotherTable a WHERE a.anotherTableID = 1
Never been to TextSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
IF NOT EXISTS ( SELECT * FROM [information_schema].[columns] WHERE table_name = 'Customer' AND table_schema = 'dbo' AND column_name = 'FavoriteColorId' ) BEGIN ALTER TABLE [dbo].[Customer] ADD FavoriteColorId int
Copy the files in your newly extracted directory (pmwik-new/wordpress-patch) over the files of your existing software installation. For example, if your existing PmWiki/Wordpress installation is in a directory called pmwiki/wordpress, then one way to copy the new files over the existing ones is to enter the command:
cp -a pmwiki-new/. pmwiki
Note that BSD systems will not have the -a option as a command-line argument for cp, but that's okay, since it's just shorthand for cp -dpR, so use that instead of -a.
On (some) FreeBSD servers and Mac OS X systems you need to use
cp -Rpv pmwiki-new/. pmwiki
This works well on TxD shared hosting.
UPDATE [Crm].[tbPartyLegalEntityData] SET [CompanyType] = ape.[CompanyType], [EmployeesCount] = ape.[EmployeesCount] FROM [Crm].[tbPartyLegalEntityData] p INNER JOIN App.[tbApplicationPersonEmployer] AS ape ON ape.[Bulstat] = p.[Bulstat] WHERE ape.[Bulstat] <> '!' AND [ape].[EmployeesCount] IS NOT NULL AND [ape].[CompanyType] IS NOT NULL
// count users with filter select Count(surname+firstname) as duplicates, surname, firstname from c_contact where show_record=1 group by surname, firstname having Count(surname+firstname) > 1 order by duplicates, surname, firstname // original code SELECT column,COUNT(*) c FROM table GROUP BY column HAVING COUNT(*) > 1 //update code update c_contact set duplicates = dbo.func_get_duplicates(surname, firstname)