This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select o.model_number, oc.model_number | |
| from Product_Staging_Table o | |
| inner join ( | |
| SELECT model_number, COUNT(*) AS dupeCount | |
| FROM Product_Staging_Table | |
| GROUP BY model_number | |
| HAVING COUNT(*) > 1 | |
| ) oc on o.model_number = oc.model_number | |
| WHERE o.model_number <> '' AND o.model_number IS NOT NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE FUNCTION [dbo].[MMDDYYYY_TO_SQL_DATE] | |
| ( | |
| @MMDDYYYY char(8) | |
| ) | |
| RETURNS date | |
| AS | |
| BEGIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from blaze import * | |
| accounts = Symbol('accounts', 'var * {id: int, name: string, amount: int}') | |
| deadbeats = accounts[accounts.amount < 100].name | |
| L = [[1, 'Alice', 100], | |
| [2, 'Bob', -200], | |
| [3, 'Charlie', 300], | |
| [4, 'Denis', 400], | |
| [5, 'Edith', -500]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Usage examples for untangle | |
| """ | |
| import untangle | |
| def access(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT MyData, | |
| EOMONTH(MyData) AS LastDayOfThisMonth, | |
| EOMONTH(MyData, 1) AS LastDayOfNextMonth | |
| FROM (VALUES ('2012-02-14T00:00:00' ), | |
| ('2012-01-01T00:00:00'), | |
| ('2012-12-31T23:59:59.9999999')) dt(MyData) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT MyData , | |
| ISDATE(MyData) AS IsADate | |
| FROM (VALUES('IsThisADate'), | |
| ('2012-02-14'), | |
| ('2012-01-01T00:00:00'), | |
| ('2012-12-31T23:59:59.9999999')) dt(MyData) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from suds.client import Client | |
| import logging | |
| logging.basicConfig(level=logging.INFO) | |
| logging.getLogger('suds.client').setLevel(logging.DEBUG) | |
| # Specify Login Information | |
| developer_key = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' | |
| password = 'xxxxxxxx' | |
| account_guid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE DatabaseNameHere | |
| SELECT | |
| -- This CASE Expression Verifies that the Value in the UPC Field is All Numbers and It's Total Length is 12 | |
| ,CASE WHEN ISNUMERIC(UPC) = 1 AND LEN([UPC]) = 12 THEN [UPC] | |
| WHEN ISNUMERIC(UPC) = 1 AND LEN([UPC]) = 11 THEN '0'+[UPC] | |
| ELSE '' END AS [UPC] | |
| FROM dbo.YourTableNameHere |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ,RIGHT(columnname, LEN(columnname) - 2) AS MyTrimmedColumn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ,REPLACE( | |
| REPLACE( | |
| REPLACE( | |
| REPLACE( | |
| REPLACE([Billing Phone],'(','') | |
| ,')','') | |
| ,'-','') | |
| ,' ','') | |
| ,'+','') AS PhoneNumber |