CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));

0

Please login or register to vote for this query.

(click on this box to dismiss)

History

Q&A for historians and history buffs

SELECT SUM(EndOfWeekUsersCount)*100/SUM(BeginOfWeekUsersCount)
FROM
--п.2 начало
(
SELECT COUNT(DISTINCT OwnerUserId) AS BeginOfWeekUsersCount FROM Posts
WHERE
CreationDate BETWEEN DATEADD(day, 0, '2008-08-01') AND 
DATEADD(day, 1, '2008-08-01')
) BeginOfWeek
--п.2 конец
FULL JOIN
--п.4 начало
(
SELECT COUNT(begin_of_week.OwnerUserId) AS EndOfWeekUsersCount
FROM
(	
SELECT DISTINCT OwnerUserId AS OwnerUserId FROM Posts
WHERE 
CreationDate BETWEEN DATEADD(day, 7, '2008-08-01') AND 
DATEADD(day, 8, '2008-08-01')
) end_of_week
INNER JOIN
(
SELECT DISTINCT OwnerUserId AS OwnerUserId FROM Posts
WHERE 
CreationDate BETWEEN DATEADD(day, 0, '2008-08-01') AND 
DATEADD(day, 1, '2008-08-01')
) begin_of_week ON end_of_week.OwnerUserId = begin_of_week.OwnerUserId
) EndOfWeek
--п.4 конец
ON
BeginOfWeek.BeginOfWeekUsersCount =  EndOfWeek.EndOfWeekUsersCount

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results