SlideShare ist ein Scribd-Unternehmen logo
1 von 70
60 Reporting Tips in
60 Minutes
April 20 - 22, 2015 | Santa Clara, CA
Ike Ellis
Partner
Crafting Bytes
SSRS: HTML color picker websites
SSRS: Skip GIS, use MorgueFile
SSMS: Query Shortcuts
SELECT COUNT(*) FROM
SELECT TOP 100 * FROM
SSMS: Don’t forget the splitter bar
SSMS: Comment Shortcut Key
CTRL-K, C
CTRL-K, U
Lifehack: Start 2014 with a jar and fill it
with notes of good things that happen
Next New Year’s Eve, empty the jar and see what awesome
stuff happened that year.
Performance: Check for heaps/clustered
indexes
SELECT t.[Name] FROM sys.Indexes i
JOIN sys.Tables t
ON t.Object_ID = i.Object_id
WHERE i.type_desc = 'HEAP'
ORDER BY t.[Name]
Performance: Index all the keys
select object_name(c.object_id), c.name from sys.columns c
where c.name like '%id'
and c.object_id not in
(
select object_id
from sys.index_columns
)
Lifehack: Readable Presentations
Take the average age of the people in your audience and
divide by 2: That’s your font size
Do you want to know what I think you’re average is? My font size is
typically 20 – 24.
SSIS: The proper way to execute an SSIS
package
Power BI - Visualization: Bad Dashboard
Power BI - Visualization: Use color
sparingly.
In nature, colors do two things:
1) Entice
2) Warn
So let’s use them sparingly..
WARNING: POISON FROG!
Power BI -Visualization: Stephen Few
Power BI - Visualization: Cynthia Brewer
Power BI: Tips for Visualization
Make the most important information the biggest
Put it in the upper-left corner
T-SQL: No reason to use ISNULL 
CONCAT!
Messy vs clean code
No + symbol needed
No ISNULL needed
Lifehack: If you backpack, but need
news, search Wikipedia by month &
year
Search Schema: Object Explorer Details
F7
Search Schema: T-SQL
select object_name(object_id), definition as name
from sys.all_sql_modules
where definition like '%cust%'
Search Schema: SQL Search - Free
SSDT: Search options
Spotlight
T-SQL: Use windowing functions
Neat evolution
Lifehack: Presentation tip
T-SQL: Prettify!
http://extras.sqlservercentral.com/prettifier/prettifier.aspx
RedGate PlugIn for SQL Server Management Studio
TSQL: Or use SQLPrompt - RedGate
T-SQL: Execute scripts over multiple
servers
Tip: Life is so easy with a dates table
Find the sales numbers for the first Monday of every month
of the year
T-SQL with no dates table
T-SQL with dates table
Lifehack: Motorcyclist signaling cop to
other motorcyclist
Looks like a siren on top!
T-SQL: Try_Cast
Avoiding terrible casting errors
T-SQL: Never reinvent the wheel – SQL#
Take SQL# for example
Good Documentation
Easy Syntax
Cheap (and much of it is free)
LIfehack: If you take a power strip to
the airport during the winter, you’ll be a
hero
T-SQL: Save scripts in a project for easy
navigation
SSRS: Log, Log, Log (and beware of
subscriptions)select c.Name
, e.InstanceName
, e.UserName
, e.Parameters
, e.TimeStart
, e.TimeEnd
, e.TimeDataRetrieval
, e.TimeProcessing
, e.TimeRendering
from executionlog e
join catalog c
on e.reportid = c.ItemID
Send a Link, or a file on a shared folder that you can audit. Find someway to audit who opened the link or the file
in the folder. Try to avoid sending the PDF without a way to audit it.
Performance: Big lines
When troubleshooting, thick rows means lots of data, thin rows mean not much data.
You’re probably better off following the thick rows.
Lifehack: Today’s most precious
commodity – FOCUS!
SSRS: Store colors in the database
Colors = Business Logic
Put it in the database
Use Expressions to read the colors
Include action colors and levels
SSRS: Get Buy-in to Export to Single
Format
Build to export to a single format
• Excel
• Word
• Web
• PDF
Then get buy-in and make it a standard in the organization
Demo: Build to export to excel
Manage: Alias, Obscure, and De-couple
Views, Aliases
Lifehack: Keep notes daily on what you
do
Makes CVs easier
Makes reviews easier
Makes promotions easier
SSAS: Views are better than DSVs
• Easier to manage
• Can use SQL Search tools
• Can use SQL Dependency Tools
• Have a set of views only used by analysis services..so you
can change them without telling anyone else
SSRS: Used Linked Reports to Manage
Security
• Allows you to use Role assignments and
• Not have duplicate reports in folders
• Not have users in folders they shouldn’t be in
• Not manage security on individual reports
Management: Use Active Directory for
report security and cube security
User
Active Directory Group
Permission
One group – One Report
Management: Keep Report Quantity
Small
Too many reports means that there are more things to keep
consistent
Reports that aren’t used, tend to get forgotten, and then
used with bad data
Manage: Interview one person at a time
when gathering requirements
Manage: Find the key person
• They know a lot
• They have time
• They respond quickly
• They are most often right
• They might not be
likeable, and that’s OK
• Success – Work in their
office
Lifehack: If you want ambient light, do
this
SSAS: Change one thing at a time
And break calculations down to their simplest form, deploy,
test, and change one more thing.
Manage: Very few KPIs and numbers!
""The well-intentioned desire to be great at everything is
precisely what leads to exhausted
mediocrity" https://www.youtube.com/watch?v=DWKvSG_
9s5I"
Walmart customer service
SSRS: Use a report footer
Put row count there
SSRS: Report footer
Put executive sponsor there & email address
Data mart: Use friendly names
everywhere
Use spaces and long names
Manage: Use a wiki for taxonomy
Record owner
Record changes
Record technical calculation
Lifehack: Have the child call you
Whenever someone comes around saying "Would you like
to buy blah blah blah, my kid is going to do whatever."
I tell them, "Yes, I would love to! But your child has to be
the one to ask me." I then give them my number and say
the child can call anytime after 6pm.
Career: Learn in a group
SSMS: Status bar on top
SSMS: Color the status bar
Excel: Defer Layout Update
SSAS – Prevent load and delay when using
pivot tables.
Excel: Four Directional Arrow for
custom sort
Excel: Sorting is by level
Excel: Filter – Keep only selected items
And hide selected item.
Notice the total changes.
Excel: Member Search
SSMS: Script parameters
Windows: Use the middle mouse
button to close tabs
Close windows fast
Works in Chrome, SSDT, SSMS, Excel, Everywhere
SSMS: Quickly alias columns
CTRL-ALT-DOWNARROW for block selection
Manage: How to share passwords
LAST TIP! My YouTube Channel!
https://www.youtube.com/user/IkeEllisData
Contact Me!
http://blog.ikeellis.com
http://www.ikeellis.com
YouTube
• http://www.youtube.com/user/IkeEllisData
SQL Pass Book Readers
• http://bookreaders.sqlpass.org/
San Diego Tech Immersion Group
Twitter: @ike_ellis
619.922.9801
Email address is just my first name @ikeellis.com
Your feedback
is important
and valuable.
Submit by
11:59 PM PT,
April 30, 2015 to
WIN prizes
Session Evaluations
Go to
passbac2015/evals
Download the PASS
EVENT App from
your App Store and
search: PASS BAC
2015
Follow the QR code
link displayed on
session signage and
in the program
guide
for attending this
session and the
PASS Business
Analytics
Conference 2015
Thank
You

Weitere ähnliche Inhalte

Was ist angesagt?

Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriarAdf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriarNilesh Shah
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseEric Bragas
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveDavide Mauri
 
Building Search Engines - Lucene, SolR and Elasticsearch
Building Search Engines - Lucene, SolR and ElasticsearchBuilding Search Engines - Lucene, SolR and Elasticsearch
Building Search Engines - Lucene, SolR and ElasticsearchRahul Singh
 
Moving to the cloud; PaaS, IaaS or Managed Instance
Moving to the cloud; PaaS, IaaS or Managed InstanceMoving to the cloud; PaaS, IaaS or Managed Instance
Moving to the cloud; PaaS, IaaS or Managed InstanceThomas Sykes
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data WarehousingDavide Mauri
 
Open Source DataViz with Apache Superset
Open Source DataViz with Apache SupersetOpen Source DataViz with Apache Superset
Open Source DataViz with Apache SupersetCarl W. Handlin
 
Tools and Tips For Data Warehouse Developers (SQLGLA)
Tools and Tips For Data Warehouse Developers (SQLGLA)Tools and Tips For Data Warehouse Developers (SQLGLA)
Tools and Tips For Data Warehouse Developers (SQLGLA)Cathrine Wilhelmsen
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)Michael Rys
 
Analyzing StackExchange data with Azure Data Lake
Analyzing StackExchange data with Azure Data LakeAnalyzing StackExchange data with Azure Data Lake
Analyzing StackExchange data with Azure Data LakeBizTalk360
 
U-SQL Federated Distributed Queries (SQLBits 2016)
U-SQL Federated Distributed Queries (SQLBits 2016)U-SQL Federated Distributed Queries (SQLBits 2016)
U-SQL Federated Distributed Queries (SQLBits 2016)Michael Rys
 
SQL Azure - the good, the bad and the ugly.
SQL Azure - the good, the bad and the ugly.SQL Azure - the good, the bad and the ugly.
SQL Azure - the good, the bad and the ugly.Pini Krisher
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQLMichael Rys
 
Building Enterprise Search Engines using Open Source Technologies
Building Enterprise Search Engines using Open Source TechnologiesBuilding Enterprise Search Engines using Open Source Technologies
Building Enterprise Search Engines using Open Source TechnologiesRahul Singh
 
U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)Michael Rys
 
OfficeWriter and the Application Platform
OfficeWriter and the Application PlatformOfficeWriter and the Application Platform
OfficeWriter and the Application PlatformSoftArtisans
 
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMicrosoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMark Kromer
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersMichael Rys
 

Was ist angesagt? (20)

Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriarAdf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
 
R in Power BI
R in Power BIR in Power BI
R in Power BI
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
Building Search Engines - Lucene, SolR and Elasticsearch
Building Search Engines - Lucene, SolR and ElasticsearchBuilding Search Engines - Lucene, SolR and Elasticsearch
Building Search Engines - Lucene, SolR and Elasticsearch
 
Moving to the cloud; PaaS, IaaS or Managed Instance
Moving to the cloud; PaaS, IaaS or Managed InstanceMoving to the cloud; PaaS, IaaS or Managed Instance
Moving to the cloud; PaaS, IaaS or Managed Instance
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
Open Source DataViz with Apache Superset
Open Source DataViz with Apache SupersetOpen Source DataViz with Apache Superset
Open Source DataViz with Apache Superset
 
Tools and Tips For Data Warehouse Developers (SQLGLA)
Tools and Tips For Data Warehouse Developers (SQLGLA)Tools and Tips For Data Warehouse Developers (SQLGLA)
Tools and Tips For Data Warehouse Developers (SQLGLA)
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)
 
Analyzing StackExchange data with Azure Data Lake
Analyzing StackExchange data with Azure Data LakeAnalyzing StackExchange data with Azure Data Lake
Analyzing StackExchange data with Azure Data Lake
 
U-SQL Federated Distributed Queries (SQLBits 2016)
U-SQL Federated Distributed Queries (SQLBits 2016)U-SQL Federated Distributed Queries (SQLBits 2016)
U-SQL Federated Distributed Queries (SQLBits 2016)
 
SQL Azure - the good, the bad and the ugly.
SQL Azure - the good, the bad and the ugly.SQL Azure - the good, the bad and the ugly.
SQL Azure - the good, the bad and the ugly.
 
Azure data lake sql konf 2016
Azure data lake   sql konf 2016Azure data lake   sql konf 2016
Azure data lake sql konf 2016
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQL
 
Building Enterprise Search Engines using Open Source Technologies
Building Enterprise Search Engines using Open Source TechnologiesBuilding Enterprise Search Engines using Open Source Technologies
Building Enterprise Search Engines using Open Source Technologies
 
U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)
 
OfficeWriter and the Application Platform
OfficeWriter and the Application PlatformOfficeWriter and the Application Platform
OfficeWriter and the Application Platform
 
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMicrosoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for Developers
 

Andere mochten auch

Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBIke Ellis
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL DevelopersIke Ellis
 
Smart Reporting: How to Stop Wasting Time and Make Better Marketing Decisions
Smart Reporting: How to Stop Wasting Time and Make Better Marketing DecisionsSmart Reporting: How to Stop Wasting Time and Make Better Marketing Decisions
Smart Reporting: How to Stop Wasting Time and Make Better Marketing DecisionsHubSpot
 
In time reporting: why is it a better alternative?
In time reporting: why is it a better alternative?In time reporting: why is it a better alternative?
In time reporting: why is it a better alternative?dhamaty
 
Reporting tips & tricks
Reporting tips & tricksReporting tips & tricks
Reporting tips & tricksmarcwan
 
Stress workshop 3 relationships 1: Couples and intimate relationships
Stress workshop 3 relationships 1: Couples and intimate relationshipsStress workshop 3 relationships 1: Couples and intimate relationships
Stress workshop 3 relationships 1: Couples and intimate relationshipsmarkdarransutton
 
Lesikar report writing basics
Lesikar   report writing basicsLesikar   report writing basics
Lesikar report writing basicsRana Usman Sattar
 
Basics (Reports Writing 2)
Basics (Reports Writing 2)Basics (Reports Writing 2)
Basics (Reports Writing 2)julianmillar
 
10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...
10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...
10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...Senturus
 
Basics (Reports Writing)
Basics (Reports Writing)Basics (Reports Writing)
Basics (Reports Writing)julianmillar
 
Mango: Successful grant management for NGOs
Mango: Successful grant management for NGOsMango: Successful grant management for NGOs
Mango: Successful grant management for NGOsTerry Lewis
 
14 Ways to Share Results with Donors
14 Ways to Share Results with Donors14 Ways to Share Results with Donors
14 Ways to Share Results with DonorsKivi Leroux Miller
 
Report writing
Report writingReport writing
Report writingimporterss
 
Ppt on Report Writing
Ppt on  Report WritingPpt on  Report Writing
Ppt on Report WritingShruti Mishra
 

Andere mochten auch (20)

Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers
 
Smart Reporting: How to Stop Wasting Time and Make Better Marketing Decisions
Smart Reporting: How to Stop Wasting Time and Make Better Marketing DecisionsSmart Reporting: How to Stop Wasting Time and Make Better Marketing Decisions
Smart Reporting: How to Stop Wasting Time and Make Better Marketing Decisions
 
In time reporting: why is it a better alternative?
In time reporting: why is it a better alternative?In time reporting: why is it a better alternative?
In time reporting: why is it a better alternative?
 
Online + reporting
Online + reportingOnline + reporting
Online + reporting
 
Reporting tips & tricks
Reporting tips & tricksReporting tips & tricks
Reporting tips & tricks
 
Moneyball
Moneyball Moneyball
Moneyball
 
Report Writing
Report WritingReport Writing
Report Writing
 
Stress workshop 3 relationships 1: Couples and intimate relationships
Stress workshop 3 relationships 1: Couples and intimate relationshipsStress workshop 3 relationships 1: Couples and intimate relationships
Stress workshop 3 relationships 1: Couples and intimate relationships
 
Lesikar report writing basics
Lesikar   report writing basicsLesikar   report writing basics
Lesikar report writing basics
 
Basics (Reports Writing 2)
Basics (Reports Writing 2)Basics (Reports Writing 2)
Basics (Reports Writing 2)
 
10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...
10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...
10 Best Practices for Tableau Dashboard Design: Data Exploration and Actionab...
 
Basics (Reports Writing)
Basics (Reports Writing)Basics (Reports Writing)
Basics (Reports Writing)
 
Basic principles of writing a report
Basic principles of writing a reportBasic principles of writing a report
Basic principles of writing a report
 
Mango: Successful grant management for NGOs
Mango: Successful grant management for NGOsMango: Successful grant management for NGOs
Mango: Successful grant management for NGOs
 
14 Ways to Share Results with Donors
14 Ways to Share Results with Donors14 Ways to Share Results with Donors
14 Ways to Share Results with Donors
 
Report writing
Report writingReport writing
Report writing
 
Ppt on Report Writing
Ppt on  Report WritingPpt on  Report Writing
Ppt on Report Writing
 
Repot writing ppt
Repot writing pptRepot writing ppt
Repot writing ppt
 
REPORT WRITTING
REPORT WRITTINGREPORT WRITTING
REPORT WRITTING
 

Ähnlich wie SQL PASS BAC - 60 reporting tips in 60 minutes

SQL Server Tips & Tricks
SQL Server Tips & TricksSQL Server Tips & Tricks
SQL Server Tips & TricksIke Ellis
 
SQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & TricksSQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & TricksIke Ellis
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...Cathrine Wilhelmsen
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...Cathrine Wilhelmsen
 
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)Cathrine Wilhelmsen
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...Cathrine Wilhelmsen
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...Cathrine Wilhelmsen
 
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019Dave Stokes
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server DatabasesColdFusionConference
 
SQL Tutorial for Marketers
SQL Tutorial for MarketersSQL Tutorial for Marketers
SQL Tutorial for MarketersJustin Mares
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 
Streaming Transformations - Putting the T in Streaming ETL
Streaming Transformations - Putting the T in Streaming ETLStreaming Transformations - Putting the T in Streaming ETL
Streaming Transformations - Putting the T in Streaming ETLconfluent
 
Big Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft AzureBig Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft AzureMark Kromer
 
SQL Server Dev ToolKit
SQL Server Dev ToolKitSQL Server Dev ToolKit
SQL Server Dev ToolKitKirsten Benzel
 
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...NoSQLmatters
 
Data Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesData Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesIvo Andreev
 
Salesforce Development Best Practices
Salesforce Development Best PracticesSalesforce Development Best Practices
Salesforce Development Best PracticesVivek Chawla
 
How Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill SetsHow Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill SetsChad Petrovay
 
Ultimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitUltimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitKevin Kline
 
Microsoft Azure Big Data Analytics
Microsoft Azure Big Data AnalyticsMicrosoft Azure Big Data Analytics
Microsoft Azure Big Data AnalyticsMark Kromer
 

Ähnlich wie SQL PASS BAC - 60 reporting tips in 60 minutes (20)

SQL Server Tips & Tricks
SQL Server Tips & TricksSQL Server Tips & Tricks
SQL Server Tips & Tricks
 
SQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & TricksSQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & Tricks
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
 
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
 
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...
 
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
SQL Tutorial for Marketers
SQL Tutorial for MarketersSQL Tutorial for Marketers
SQL Tutorial for Marketers
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
Streaming Transformations - Putting the T in Streaming ETL
Streaming Transformations - Putting the T in Streaming ETLStreaming Transformations - Putting the T in Streaming ETL
Streaming Transformations - Putting the T in Streaming ETL
 
Big Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft AzureBig Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft Azure
 
SQL Server Dev ToolKit
SQL Server Dev ToolKitSQL Server Dev ToolKit
SQL Server Dev ToolKit
 
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
 
Data Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesData Warehouse Design and Best Practices
Data Warehouse Design and Best Practices
 
Salesforce Development Best Practices
Salesforce Development Best PracticesSalesforce Development Best Practices
Salesforce Development Best Practices
 
How Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill SetsHow Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill Sets
 
Ultimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitUltimate Free SQL Server Toolkit
Ultimate Free SQL Server Toolkit
 
Microsoft Azure Big Data Analytics
Microsoft Azure Big Data AnalyticsMicrosoft Azure Big Data Analytics
Microsoft Azure Big Data Analytics
 

Mehr von Ike Ellis

Storytelling with Data with Power BI
Storytelling with Data with Power BIStorytelling with Data with Power BI
Storytelling with Data with Power BIIke Ellis
 
Storytelling with Data with Power BI.pptx
Storytelling with Data with Power BI.pptxStorytelling with Data with Power BI.pptx
Storytelling with Data with Power BI.pptxIke Ellis
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptxIke Ellis
 
Data Modeling on Azure for Analytics
Data Modeling on Azure for AnalyticsData Modeling on Azure for Analytics
Data Modeling on Azure for AnalyticsIke Ellis
 
Migrate a successful transactional database to azure
Migrate a successful transactional database to azureMigrate a successful transactional database to azure
Migrate a successful transactional database to azureIke Ellis
 
Data modeling trends for analytics
Data modeling trends for analyticsData modeling trends for analytics
Data modeling trends for analyticsIke Ellis
 
Relational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsRelational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsIke Ellis
 
Power bi premium
Power bi premiumPower bi premium
Power bi premiumIke Ellis
 
Move a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloudMove a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloudIke Ellis
 
Pass 2018 introduction to dax
Pass 2018 introduction to daxPass 2018 introduction to dax
Pass 2018 introduction to daxIke Ellis
 
Pass the Power BI Exam
Pass the Power BI ExamPass the Power BI Exam
Pass the Power BI ExamIke Ellis
 
Slides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATESlides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATEIke Ellis
 
Introduction to DAX
Introduction to DAXIntroduction to DAX
Introduction to DAXIke Ellis
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL DevelopersIke Ellis
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL DevelopersIke Ellis
 
Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Ike Ellis
 
Survey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data LandscapeSurvey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data LandscapeIke Ellis
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101Ike Ellis
 
Hadoop for the Absolute Beginner
Hadoop for the Absolute BeginnerHadoop for the Absolute Beginner
Hadoop for the Absolute BeginnerIke Ellis
 
Continuous integration sql in the city
Continuous integration sql in the cityContinuous integration sql in the city
Continuous integration sql in the cityIke Ellis
 

Mehr von Ike Ellis (20)

Storytelling with Data with Power BI
Storytelling with Data with Power BIStorytelling with Data with Power BI
Storytelling with Data with Power BI
 
Storytelling with Data with Power BI.pptx
Storytelling with Data with Power BI.pptxStorytelling with Data with Power BI.pptx
Storytelling with Data with Power BI.pptx
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptx
 
Data Modeling on Azure for Analytics
Data Modeling on Azure for AnalyticsData Modeling on Azure for Analytics
Data Modeling on Azure for Analytics
 
Migrate a successful transactional database to azure
Migrate a successful transactional database to azureMigrate a successful transactional database to azure
Migrate a successful transactional database to azure
 
Data modeling trends for analytics
Data modeling trends for analyticsData modeling trends for analytics
Data modeling trends for analytics
 
Relational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsRelational data modeling trends for transactional applications
Relational data modeling trends for transactional applications
 
Power bi premium
Power bi premiumPower bi premium
Power bi premium
 
Move a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloudMove a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloud
 
Pass 2018 introduction to dax
Pass 2018 introduction to daxPass 2018 introduction to dax
Pass 2018 introduction to dax
 
Pass the Power BI Exam
Pass the Power BI ExamPass the Power BI Exam
Pass the Power BI Exam
 
Slides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATESlides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATE
 
Introduction to DAX
Introduction to DAXIntroduction to DAX
Introduction to DAX
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017
 
Survey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data LandscapeSurvey of the Microsoft Azure Data Landscape
Survey of the Microsoft Azure Data Landscape
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
 
Hadoop for the Absolute Beginner
Hadoop for the Absolute BeginnerHadoop for the Absolute Beginner
Hadoop for the Absolute Beginner
 
Continuous integration sql in the city
Continuous integration sql in the cityContinuous integration sql in the city
Continuous integration sql in the city
 

Kürzlich hochgeladen

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Kürzlich hochgeladen (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

SQL PASS BAC - 60 reporting tips in 60 minutes

Hinweis der Redaktion

  1. update sales.customers set contacttitle = null where custid in ('59', '66', '78', '15') use tsql2012 select * from sales.customers select ContactName + ' - ' + ContactTitle + ', ' + City as GreetingLine from sales.customers select isnull(ContactName, '') + ' - ' + isnull(ContactTitle, '') + ', ' + isnull(City, '') as GreetingLine from sales.customers select concat(ContactName, ' ', ContactTitle, ' ', City) as GreetingLine from sales.customers
  2. use tsql2012 select * from sales.orders select custid, freight from sales.orders select custid, freight, sum(freight) as totalFreight from sales.orders select custid, sum(freight) as totalFreight from sales.orders group by custid select custid, freight, sum(freight) as totalFreight from sales.orders group by custid select custid, freight, sum(freight) as totalFreight from sales.orders group by custid, freight --we're skipping subqueries, because they look ugly and --it insults me aesthetically ;with FreightTotal as ( select custid, sum(freight) as totalFreight from sales.orders group by custid ) select o.custid , o.freight , ft.totalFreight as totalFreight from sales.orders o join FreightTotal ft on o.custid = ft.custid --BIG IMPROVEMENT --query can be executed independantly --Can be reused, like this ;with FreightTotal as ( select custid, sum(freight) as totalFreight from sales.orders group by custid ) select o.custid , o.freight , ft.totalFreight as totalFreight , o.freight /ft.totalfreight * 100 as FreightPercentage from sales.orders o join FreightTotal ft on o.custid = ft.custid --but remember our original thought process select custid, freight, sum(freight) as totalFreight from sales.orders --here's a windowing function select custid , freight , sum(freight) over (partition by custid) as totalFreight from sales.orders --and reusing it is not that big of a deal select custid , freight , sum(freight) over (partition by custid) as totalFreight , freight / sum(freight) over (partition by custid) * 100 as FreightPercentage from sales.orders
  3. SELECT * FROM (SELECT urgency, name, phone, location, department, cc, status, case_manager, ip, case_manager_ei d, id_problem, id_problem_type, eid_author, title, body, date_created, date_modified FROM problems AS main INNER JOIN (SELECT id_problem as t_urgency_id_problem, node_value AS urgency FROM problem_nodes WHERE node_name = "urgency")t_urgency ON t_urgency.t_urgency_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_name_id_problem, node_value AS name FROM problem_nodes WHERE node_name = "name")t_name ON t_name.t_name_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_phone_id_problem, node_value AS phone FROM problem_nodes WHERE node_name = "phone")t_phone ON t_phone.t_phone_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_location_id_problem, node_value AS location FROM problem_nodes WHERE node_name = "location")t_location ON t_location.t_location_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_department_id_problem, node_value AS department FROM problem_nodes WHERE node_name = "department")t_department ON t_department.t_department_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_cc_id_problem, node_value AS cc FROM problem_nodes WHERE node_name = "cc")t_cc ON t_cc.t_cc_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_status_id_problem, node_value AS status FROM problem_nodes WHERE node_name = "status")t_status ON t_status.t_status_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_case_manager_id_problem, node_value AS case_manager FROM problem_nodes WHERE node_name = "case_manager")t_case_manager ON t_case_manager.t_case_manager_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_ip_id_problem, node_value AS ip FROM problem_nodes WHERE node_name = "ip")t_ip ON t_ip.t_ip_id_problem = main.id_problem INNER JOIN (SELECT id_problem as t_case_manager_eid_id_problem, node_value AS case_manager_eid FROM problem_nodes WHERE node_name = "case_manager_eid") t_case_manager_eid ON t_case_manager_eid.t_case_manager_eid_id_problem = main.id_problem)t
  4. ;with FirstMondays as ( Select DateAdd(day, (9-DatePart(weekday, DateAdd(Month, 1+DateDiff(Month, 0, '12/1/2009'), 0)))%7, DateAdd(Month, 1+DateDiff(Month, 0, '12/1/2009'), 0)) as FirstMonday union all select DateAdd(day, (9-DatePart(weekday, DateAdd(Month, 1+DateDiff(Month, 0, FirstMonday), 0)))%7, DateAdd(Month, 1+DateDiff(Month, 0, FirstMonday), 0)) from FirstMondays where firstMonday <= '12/1/2010' ) select * from FirstMondays use adventureworksdw2012 select EnglishMonthName, min(datekey) from dimdate where englishdaynameofweek = 'monday' and calendaryear = '2010' group by EnglishMonthName, MonthNumberOfYear order by MonthNumberOfYear
  5. create table t1 (col1 varchar(100)) insert into t1 (col1) values ('1') ,('2') ,('3') ,('ike') ,('1') ,('2') ,('3') ,('ike') , ('1') ,('2') ,('3') ,('ike') select cast(col1 as int) from t1 select try_cast(col1 as int) from t1
  6. SELECT SQL#.Date_Format('2009-12-03 12:45:56.345', 'D', '') -- Thursday, December 03, 2009 SELECT SQL#.Date_Format('2009-12-03 12:45:56.345', 'D', 'de') SELECT SQL#.Date_Format('2009-12-03 12:45:56.345', 'D', 'fr-fr') -- jeudi 3 décembre 2009 SELECT SQL#.Date_Format('2009-12-03 12:45:56.345', 'dd', '') -- 03 SELECT SQL#.Date_Format('2009-12-03 12:45:56.345', 'dd-MMM', '') SELECT SQL#.Date_Format('2009-12-03 12:45:56.345', 'tt', 'ja-jp') -- 午後 SELECT SQL#.Math_IsPrime(12318237133333)
  7. SELECT * FROM sales.Customers WHERE custid = <custid, int, 0> SELECT * FROM sales.customers c JOIN sales.orders o ON c.custid = o.custid WHERE c.custid = <custid, int, 0> AND o.orderdate > <orderdate, datetime, '1/1/2015'>