Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
6d0a38f5
Commit
6d0a38f5
authored
Aug 16, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a label in sql union statement at getClickZeroUidRateDetail.py
parent
6cb6342a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
getClickZeroUidRateDetail.py
eda/recommended_indexs/getClickZeroUidRateDetail.py
+6
-6
No files found.
eda/recommended_indexs/getClickZeroUidRateDetail.py
View file @
6d0a38f5
...
...
@@ -28,7 +28,7 @@ def get_rate_detail(platform):
platform
=
" is not null"
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_test'
)
cursor
=
db
.
cursor
()
sql
=
"select count(distinct(device_id)) from data_feed_exposure
\
sql
=
"select
'0-7' as label,
count(distinct(device_id)) from data_feed_exposure
\
where device_type{0}
\
and from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -1 day)
\
and device_id not in
\
...
...
@@ -42,7 +42,7 @@ def get_rate_detail(platform):
(select distinct(device_id) from data_feed_exposure
\
where time < {2}))
\
union all
\
select count(distinct(device_id)) from data_feed_exposure
\
select
'7-14' as label,
count(distinct(device_id)) from data_feed_exposure
\
where device_type{0}
\
and from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -1 day)
\
and device_id not in
\
...
...
@@ -59,7 +59,7 @@ def get_rate_detail(platform):
(select distinct(device_id) from data_feed_exposure
\
where time < {2}))
\
union all
\
select count(distinct(device_id)) from data_feed_exposure
\
select
'14-30' as label,
count(distinct(device_id)) from data_feed_exposure
\
where device_type{0}
\
and from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -1 day)
\
and device_id not in
\
...
...
@@ -76,7 +76,7 @@ def get_rate_detail(platform):
(select distinct(device_id) from data_feed_exposure
\
where time < {3}))
\
union all
\
select count(distinct(device_id)) from data_feed_exposure
\
select
'30-60' as label,
count(distinct(device_id)) from data_feed_exposure
\
where device_type{0}
\
and from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -1 day)
\
and device_id not in
\
...
...
@@ -93,7 +93,7 @@ def get_rate_detail(platform):
(select distinct(device_id) from data_feed_exposure
\
where time < {4}))
\
union all
\
select count(distinct(device_id)) from data_feed_exposure
\
select
'60-90' as label,
count(distinct(device_id)) from data_feed_exposure
\
where device_type{0}
\
and from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -1 day)
\
and device_id not in
\
...
...
@@ -110,7 +110,7 @@ def get_rate_detail(platform):
(select distinct(device_id) from data_feed_exposure
\
where time < {5}))
\
union all
\
select count(distinct(device_id)) from data_feed_exposure
\
select
'90+' as label,
count(distinct(device_id)) from data_feed_exposure
\
where device_type{0}
\
and from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -1 day)
\
and device_id not in
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment