由买买提看人间百态

topics

全部话题 - 话题: ndays
(共0页)
l******b
发帖数: 39
1
来自主题: Database版 - sql的2个问题 (转载)
个人认为解决此问题最佳方法window partitioning + cross apply
T-SQL 2012 提供CROSS APPLY比Oracle 11.2(不提供CROSS APPLY)稍胜一筹.
T-SQL method
---------------------------------
CREATE TABLE t9(
acct VARCHAR(20),
status VARCHAR(20),
nDay int
);
INSERT INTO t9(acct,status, nDay) VALUES('Acct1', 'A', 1) ;
INSERT INTO t9(acct,status, nDay) VALUES('Acct1', 'B', 5) ;
INSERT INTO t9(acct,status, nDay) VALUES('Acct1', 'C', 8) ;
INSERT INTO t9(acct,status, nDay) VALUES('Acct1', 'D', 9) ;
... 阅读全帖
l******b
发帖数: 39
2
来自主题: Database版 - sql的2个问题 (转载)
Workaround for Oracle earlier than 12.1
CREATE OR REPLACE TYPE int_row_table AS TABLE OF NUMBER;
/
-- Table Function is actually a parameter view.
CREATE OR REPLACE FUNCTION get_int_table
(
p_start IN NUMBER,
p_num in number
) RETURN int_row_table IS
l_result int_row_table ;
CURSOR C IS
WITH KK AS
(SELECT ROWNUM AS nD FROM dual CONNECT BY LEVEL <=10)
SELECT nD FROM KK WHERE nD BETWEEN p_start AND p_start + p_num
- 1;
BEGIN
... 阅读全帖
S********a
发帖数: 359
3
来自主题: Statistics版 - 【包子】R 时间变量做减法
下面是用SAS写的,用R怎么写呢?
data a;
set a;
if yea2=99 then ndays=dob_c1-'31DEC1998'd;
else if yea2=0 then ndays=dob_c1-'31DEC1999'd;
else if yea2=1 then ndays=dob_c1-'31DEC2000'd;
else if yea2=2 then ndays=dob_c1-'31DEC2001'd;
else if yea2=3 then ndays=dob_c1-'31DEC2002'd;
run;
data a;
set a;
allndays=dob_c1-'8APR1999'd;
run;
dob_c1的值是:01/01/2000, 01/02/2000,。。。。。。up to 12/31/2003
谢谢!
s****h
发帖数: 3979
4
来自主题: Programming版 - question about using Hive parameter (转载)
【 以下文字转载自 DataSciences 讨论区 】
发信人: squash (南瓜之夭夭), 信区: DataSciences
标 题: question about using Hive parameter
发信站: BBS 未名空间站 (Fri Oct 17 15:20:07 2014, 美东)
question about Hive parameter
Support we have some parameters as:
set nyear = '2014';
set nmonth = '10';
set nday = '17';
We generate a new parameter as:
set newdatestring = concat('/foldername/', ${hiveconf:nyear}, '/', ${
hiveconf:nmonth}, '/', ${hiveconf:nday},'/');
Comparing 2 queries
q1:
select ${hiveconf:newdatestring};
q1 output:
/folde... 阅读全帖
s****h
发帖数: 3979
5
来自主题: DataSciences版 - question about using Hive parameter
question about Hive parameter
Support we have some parameters as:
set nyear = '2014';
set nmonth = '10';
set nday = '17';
We generate a new parameter as:
set newdatestring = concat('/foldername/', ${hiveconf:nyear}, '/', ${
hiveconf:nmonth}, '/', ${hiveconf:nday},'/');
Comparing 2 queries
q1:
select ${hiveconf:newdatestring};
q1 output:
/foldername/2014/10/17/
q2:
select "${hiveconf:newdatestring}";
q2 output:
concat('/foldername/', '2014', '/', '10', '/', '17','/')
The question: is there any se... 阅读全帖
p****x
发帖数: 4260
6
1. all checks are required to be endorsed before being cashed
2. wait until Monday or Tuesday to check with UPS tracking again
3 your lg may have got a wrong tracking number, check with the manager on
Mo
nday.
4... wow. a pretty good hole at boring Sat night.

Number
i***o
发帖数: 1509
7
来自主题: NextGeneration版 - 27周,开始做生孩子的梦了
好玩~~btw,26w+nd是27周,还是27w+ndays是27周啊?汗。。。
m*********r
发帖数: 4692
8
来自主题: Football版 - Williams tests positive for fourth time
Miami Dolphins running back Ricky Williams has violated the NFL's substa
nce abuse policy for a fourth time and is facing a one-year suspension f
or the positive drug test, Denver television station KDVR reported on Su
nday.
The Miami Herald, citing two sources of its own, confirmed the station's
report that Williams had failed the test, but neither media outlet woul
d say which substance Williams used. The Herald also said a league sourc
e would not confirm the report.
Williams has tested posit
T****r
发帖数: 22092
9
发信人: pole (bbs), 信区: NewExpress
标 题: 美国国务院正式否认“避难”事件 (译文)
发信站: 水木社区 (Thu Feb 9 08:05:42 2012), 站内
美国国务院新闻稿原帖:
http://www.state.gov/r/pa/prs/dpb/2012/02/183574.htm#CHINA
Victoria Nuland Spokesperson 国务院发言人 维多利亚-努兰德
Daily Press Briefing每日新闻发布会
Washington, DC,February 8, 2012 2012年2月八日,华盛顿
发布会内容提要
DEPARTMENT 国务院
•Conference Call on Right-Sizing Mission in Iraq
•Sen. Graham to Brief Secretary Clinton on Africa Trip
CHINA 中国 (排名第二,坐实老二地位)
•Vice Mayor Wang Lijun Meeting at Chengdu... 阅读全帖
m**x
发帖数: 8454
10
【 以下文字转载自 WaterWorld 讨论区 】
发信人: Teller (yy), 信区: WaterWorld
标 题: 美国国务院正式否认“避难”事件 (译文)zz
发信站: BBS 未名空间站 (Wed Feb 8 19:16:54 2012, 美东)
发信人: pole (bbs), 信区: NewExpress
标 题: 美国国务院正式否认“避难”事件 (译文)
发信站: 水木社区 (Thu Feb 9 08:05:42 2012), 站内
美国国务院新闻稿原帖:
http://www.state.gov/r/pa/prs/dpb/2012/02/183574.htm#CHINA
Victoria Nuland Spokesperson 国务院发言人 维多利亚-努兰德
Daily Press Briefing每日新闻发布会
Washington, DC,February 8, 2012 2012年2月八日,华盛顿
发布会内容提要
DEPARTMENT 国务院
•Conference Call on Right-Sizing Mission in I... 阅读全帖
d*******3
发帖数: 58
11
来自主题: DataSciences版 - question about using Hive parameter
参数变量放在脚本里处理,再传给hive 执行该多方便
#!/bin/bash
nyear='2014'
nmonth='10'
nday='17'
hql="
create external table tableone
(
id int
) LOCATION '$LOCATION'
"
hive -e "$hql"
d*******3
发帖数: 58
12
来自主题: DataSciences版 - question about using Hive parameter
写漏了
LOCATION="/foldername/$nyear/$nmonth/$nday"
(共0页)