This file contains 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
WITH MEMBER [Measures].[Reseller Sales YTD] AS Sum( YTD( [Date].[Calendar Weeks].CurrentMember ), [Measures].[Reseller Sales Amount] ) | |
SELECT { [Measures].[Reseller Sales Amount], [Measures].[Reseller Sales YTD] } ON 0, | |
{ [Date].[Calendar Weeks].[Calendar Week].MEMBERS } ON 1 | |
FROM [Adventure Works] |
This file contains 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
MEMBER [Measures].[Proof] AS iif( IsEmpty( [Measures].[Order Count] ), null, iif( IsLeaf( [Date].[Fiscal Weeks].CurrentMember ), [Measures].[Order Count], '( ' + Generate( [Date].[Fiscal Weeks] .CurrentMember.Children, iif( IsEmpty( [Measures] .[Average of an average] ), '(null)', CStr( Round( [Measures] .[Average of an average], 0 ) ) ), ' + ' ) + ' ) / ' + CStr( NonEmpty( [Date].[Fiscal Weeks] .CurrentMember.Children, [Measures].[Order Count] ).Count ) ) ) |
This file contains 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
WITH MEMBER [Measures].[Average of an average] AS iif( IsLeaf( [Date].[Fiscal Weeks].CurrentMember ), | |
[Measures].[Order Count], Avg( [Date].[Fiscal Weeks].CurrentMember.Children, [Measures].[Average of an average] ) ) | |
, FORMAT_STRING = '#,#' |
This file contains 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
http://stackoverflow.com/questions/14622940/insert-into-table-exec-query |
This file contains 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
-- Connecting to Vertica via pyvertica | |
__author__ = 'vosipov' | |
from pyvertica.connection import get_connection | |
conn = get_connection(False, driver='{Vertica}', server='192.168.30.128', database='VMart', port=5433, uid='dbadmin', pwd='password') | |
cursor = conn.cursor() | |
for row in cursor.execute("SELECT table_name FROM tables;"): | |
print row | |
conn.close() |
This file contains 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 COUNT(Name) AS ExecutionCount, | |
Name, | |
SUM(TimeDataRetrieval ) AS TimeDataRetrievalSum, | |
SUM(TimeProcessing ) AS TimeProcessingSum, | |
SUM(TimeRendering ) AS TimeRenderingSum, | |
SUM(ByteCount ) AS ByteCountSum, | |
SUM([RowCount] ) AS RowCountSum | |
FROM | |
( | |
SELECT TimeStart, |
This file contains 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
@defer.inlineCallbacks | |
def parse_next_page(self, response): | |
log.msg('Test: in parse_next_page, status=%s' % response.status, level=log.WARNING) | |
res = [] | |
if response.status != 302: | |
text = '' | |
try: | |
text = response.xpath('./component/text()').extract()[0] | |
except: | |
pass |
This file contains 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
# -*- coding: utf-8 -*- | |
from django.core.management.base import AppCommand | |
from commission.izbirkom_parser import parser | |
from commission.models import Comission | |
import lxml.html as html | |
import urllib2, urllib | |
import json | |
import re | |
import time |
This file contains 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
WITH [Waits] AS | |
(SELECT | |
[wait_type], | |
[wait_time_ms] / 1000.0 AS [WaitS], | |
([wait_time_ms] - [signal_wait_time_ms]) / 1000.0 AS [ResourceS], | |
[signal_wait_time_ms] / 1000.0 AS [SignalS], | |
[waiting_tasks_count] AS [WaitCount], | |
100.0 * [wait_time_ms] / SUM ([wait_time_ms]) OVER() AS [Percentage], | |
ROW_NUMBER() OVER(ORDER BY [wait_time_ms] DESC) AS [RowNum] | |
FROM sys.dm_os_wait_stats |
This file contains 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 [msdb] | |
GO | |
SELECT j.job_id, | |
s.srvname, | |
j.name, | |
js.step_id, | |
js.command, | |
j.enabled | |
FROM dbo.sysjobs j | |
JOIN dbo.sysjobsteps js |