I******0 发帖数: 182 | 1 填的啥?
假如select出来的结果是 A B
刚才那个语句出来就是
col1 col2 col3
1 2 A
? ? B
这样吗? |
|
s********e 发帖数: 893 | 2 col1 col2 col3
1 2 A
1 2 B
你用数据试一下就明白了。 |
|
w*****m 发帖数: 20421 | 3 当然是
col1 col2 col3
1 2 A
1 2 B |
|
i*******d 发帖数: 81 | 4 想到的几点:
1.A 的三个column合并成一个。这样只要比较一次。中间加个特殊字符,防止引入不该
有的match
COALESCE(col1,'') + '|' + COALESCE(col2,'') + '|' + COALESCE(col3,'')
2.可以对新的column加full text index
3.对cursor循环加终止条件,找到match了就终止。可以省一半时间。
你可以先试试1+3. |
|
l******9 发帖数: 579 | 5 the types:
col1 INT
col2 INT
col3 INT
col4 DOUBLE PRECISION
thanks ! |
|
k********e 发帖数: 702 | 6 SELECT *
FROM table2 t2
ORDER BY t2.col1 asc, t2.col2 asc, t2.col3 asc, t2.col4 asc, t2.col5 asc |
|
a**d 发帖数: 4285 | 7 执行了一下,可行:
select t1.col1, t1.col2, t1.col3,
col4= case when t2.col1 is not null then 1
else 0
end
into table_new
from table1 t1 left join table2 t2 on t1.col1=t2.col1 |
|
h******y 发帖数: 25 | 8 具体例子如下:
select * from table -- gives the following output
server col2 col3 col4 col5 col6 col7 col8 col9 col10
1 1234 null null 678 987 890 null 567 null
1 4565 null null 234 67 56 null 345 null
2 null null 578 567 234 null 73 18 null
2 null null 626 289 395 null 84 399 null
3 567 null 845 null 987 674 null null... 阅读全帖 |
|
i*******d 发帖数: 81 | 9 why data appears in pairs? is it always true?
What is the desired output if you have:
server col2 col3 col4 col5 col6 col7 col8 col9 col10
1 1234 null null 678 987 890 null 567 null
1 null null null 234 67 56 null 345 null
null
null
null
648
921 |
|
h**u 发帖数: 1512 | 10 我有下列一组数据:
COL1 COL2 COL3 COL4
1 A1 A2 A3 NULL
2 A1 A2 A3 A4
3 B1 B2 B3 NULL
4 B1 B2 B3 B4
5 C1 C2 C3 NULL
6 C1 C2 C3 C4
我想如果count(COL1)>1 就只显示row2,4,6,除去null的1,3,5。该如何实现呢
?多谢了。 |
|
w*r 发帖数: 2421 | 11 your requirement is typical for informatica work.. if your company willing
to
buy such tool . If not, write a script parser in java to parse something
like:
File=abc.dat
layout
column1Var char(10)
column2Var char(20);
insert into tableA(
col1,col2,col3) values(
simple lexicon rules, var defines in layout block, ETL/ELT block using SQL-
like
constructs to do the insert/update/upsert
Handle everything in Java using connection.preparestatement();
then you should be fine.
If application requires per |
|
x**l 发帖数: 369 | 12 SQL新手,做PROJECT碰到这样一个问题:
用户给的一个SQL语句
SELECT * FROM a
WHERE col1 = ('DE00000009')
AND (col2 = 'WRA0020' or col2 = 'OO0036' or col2 = 'WRA0019' or col2 = '
OO0033')
返回下列结果:
year col2 col3
2009 OO0033 3440.0000
2009 OO0036 330.0000
2009 WRA0019 259.9360
2009 WRA0020 1756.3800
2010 OO0033 3750.0000
2010 OO0036 375.0000
2010 WRA0019 282.4740
2010 WRA0020 2048.8700
2011 OO0033 4210.0000
2011 OO0036 285.2200
2011 WRA0019 789.3160
20... 阅读全帖 |
|
g*********h 发帖数: 21 | 13 but seems tabular also not work
\begin{tabular}{|c|}
%
after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
\begin{figure}
% Requires \usepackage{graphicx}
\includegraphics[width=3in]{./Chapter-3/Figures/fusion_psnr.eps}
\end{figure}
\end{tabular} |
|
|
|
p*****o 发帖数: 543 | 16 如果我有一个DATA SET A,不知道里面有多少变量,也不知道变量的名字。
请问有没有办法讲变量的名称改为:COL1,COL2,COL3,...COLN?
谢谢!! |
|
w******a 发帖数: 25 | 17 Here is an R example to impute one or two missing data in each record:
The data will look like
col1 col2 col3
x
x x x
x x
x x
x x x
x
x x x
...
library(Rlab)
alp = 1
K_delta = 2
len_Y1 = 200
#Sample setting:
#Measurment N_
patient Percent
# 1 12
0.18
# 1 2 4
0.05... 阅读全帖 |
|
d********h 发帖数: 2048 | 18 proc transpose data=test out=test1;
var feature;
by id;
data test2;
length c $ 1000;
set test1 ;
array tmp col1-col3;
do over tmp;
c=catx("_",of c tmp);
end;
proc print; |
|
d******9 发帖数: 404 | 19 Nice idea.
Proc transpose 这个思路我也想到过,先 transpose , Array, 然后再合并字符串。
不过,写到半途而废了。
Array tmp col1-col3; 这里有一个问题,如果transpose 后不止3个 column,5,7个
或者更多怎么办???这里应该定义一个可变的变量才好。 |
|
h********o 发帖数: 103 | 20 DATA ONE;
INPUT VAR $ @@;
CARDS;
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14
;
DATA ONE;
SET ONE;
RETAIN ID ;
IF MOD(_N_, 5) = 1 THEN ID + 1;
RUN;
PROC TRANSPOSE DATA = ONE OUT = TWO (DROP = _NAME_ ID
RENAME = (COL1 = VAR1
COL2 = VAR2
COL3 = VAR3
COL4 = VAR4
C... 阅读全帖 |
|
i*****y 发帖数: 188 | 21 Hi everyone,
I have a question that needs help.
I have a data frame, let's say, 4 columns;
Now i want to calculate the ratio of col1/col4, col2/col4, col3/col4;
Sure we could do it manually. But I was just wondering if there is any
function available for doing this?
Thanks a lot |
|
o****o 发帖数: 8077 | 22 data _xxx;
input var1 var2 var3 var4;
cards;
2 4 6 7
4 9 7 6
5 2 1 1
7 3 7 3
;
run;
proc transpose data=_xxx out=_xxx2;
run;
proc means data=_xxx2 noprint;
var col1-col4;
output out=_xxx3(keep=v1-v4)
maxid(col1(_name_)
col2(_name_)
col3(_name_)
col4(_NAME_))= v1-v4/autoname;
run;
proc transpose data=_xxx3 out=_xxx3t;
var v1-v4;
run;
d... 阅读全帖 |
|
y********0 发帖数: 638 | 23 是用sql,转置一下,取个最小值就成。
data one;
infile datalines;
input id date mmddyy10.;
datalines;
1 08/12/2005
1 09/13/2005
2 01/09/2005
3 01/08/2005
3 01/08/2005
3 02/09/2005
;
proc transpose data=one out=two;
by id;
run;
proc sql;
select id,min(col1,col2,col3) as mdate format=mmddyy10.
from two;
quit; |
|