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
| substring( LEFT([Product Details], charindex('Product Name', [Product Details], CHARINDEX('SKU: ', [Product Details]))-3), CHARINDEX('SKU: ', [Product Details]) + len('SKU: '), LEN([Product Details])) |
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
| DECLARE @Heroes TABLE ( | |
| [HeroName] VARCHAR(20) | |
| ) | |
| INSERT INTO @Heroes ( [HeroName] ) | |
| VALUES ( 'Superman' ), ( 'Batman' ), ('Ironman'), ('Wolverine') | |
| --SELECT * FROM @Heroes | |
| SELECT STUFF((SELECT ',' + [HeroName] | |
| FROM @Heroes |
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
| DECLARE @MMDDYYYY VARCHAR(10) | |
| SET @MMDDYYYY = '07042013' | |
| SELECT STUFF(STUFF(@MMDDYYYY, 3, 0, '/'), 6, 0, '/') AS [MM/DD/YYYY] |
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 | |
| SUBSTRING([Customer Phone], 1, 3) + '-' + SUBSTRING([Customer Phone], 4, 3) + '-' +SUBSTRING([Customer Phone], 7, 4) | |
| FROM tablename |
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
| import bubbles | |
| URL = "https://raw.github.com/Stiivi/cubes/master/examples/hello_world/data.csv" | |
| p = bubbles.Pipeline() | |
| p.source(bubbles.data_object("csv_source", URL, infer_fields=True)) | |
| p.aggregate("Category", "Amount (US$, Millions)") | |
| p.pretty_print() |
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
| import smtplib | |
| fromaddr = 'email@gmail.com' | |
| toaddrs = 'email@gmail.com' | |
| msg = 'There was a terrible error that occured and I wanted you to know!' | |
| # Credentials (if needed) | |
| username = 'email@gmail.com' | |
| password = '' |
NewerOlder