由买买提看人间百态

topics

全部话题 - 话题: field1
1 (共1页)
a*******t
发帖数: 891
1
来自主题: Database版 - 问一个小问题!
SELECT
Left([field1], inStr([field1], ",") - 1 ) AS lastName,
Right([field1], inStr([field1], ",") ) AS firstName
FROM Table1;
then I switched to design view and those showed up in the "field" boxes:
lastName: Left([field1],InStr([field1],",")-1)
firstName: Right([field1],InStr([field1],","))
http://office.microsoft.com/en-us/assistance/HA010547271033.aspx


view
L**********1
发帖数: 797
2
来自主题: Fishing版 - 问个数据库问题,即删
if you want to count function,
you need to add something like this: group by field1
so the final SQL looks like below,
select field1, count(field1) from table1 group by field1
B*****g
发帖数: 34098
3
select t1.id, t1.f1,t2.f2,t3.f3
from (select id, last(field1) as f1
from table1
where field1 is not null
group by id) t1,
(select id, last(field2) as f2
from table1
where field2 is not null
group by id) t2,
(select id, last(field3) as f3
from table1
where field3 is not null
group by id) t3
where t1.id = t2.id
and t1.id= t3.id
or
select t0.id,
(select last(t1.field1) from table1 t1 where t1.id = t0.id and t1.fie
ld1 is not null) AS field1,
(select last(t2.field2) from table1 t2 wher
g***j
发帖数: 40861
4
来自主题: Xibei版 - 请教老乡 perl (转载)
要速度,谢谢啊。
不过还是有点问题啊。
这是我的程序
open(in_file," while ($line=)
{($field1,$field2,$field3,$field4)=split',',$line;
if ($field4=~ /.\s./) {print "$field1,"$field4"";}
else {print "$field1,$field4";}
}
close (in_file);
这是我的结果
TTT,Phenylalanine
TTC,Phenylalanine
TTA,Leucine
TTG,Leucine
TCT,Serine
TCC,Serine
TCA,Serine
TCG,Serine
TAT,Tyrosine
TAC,Tyrosine
TAA,Stop
TAG,Stop
TGT,Cysteine
TGC,Cysteine
TGA,Stop
TGG,Tryptophan
CTT,Leucine
CTC,Leucine
CTA,Le
g***j
发帖数: 40861
5
来自主题: Xibei版 - 请教老乡 perl (转载)
谢谢啊,做出来了
我对编程一点不知道
这只是生物信息学的一道作业
现在我的程序是:
open(in_file," while ($line=)
{($field1,$field2,$field3,$field4)=split',',$line;
if ($field4=~ /.\s./) { chomp($field4); {print "$field1,"$field4"\n";}}
else {print "$field1,$field4";}
}
close (in_file);
谢谢!
s**********r
发帖数: 286
6
来自主题: BuildingWeb版 - javascript auto complete issue
新手上路, 不好意思, 问个很初级的问题. Javascript和html在下面. 目的是要用
fielda决定fieldb的自动填项.
如果我在fielda选"Yes", fieldb会自动填入"T1". 但是, 如果我选"No", fieldb也会
自动填入"T1", 而不是期待的"T2". 错误处在哪呢? 多谢指教!
function testauto() {
var field1 = document.getElementById('fielda');
var field2 = document.getElementById('fieldb');
if (field1.value = "Yes") {
field2.value = "T1";
} else if (field1.value = "No") {
field2.value = "T2";
} else {
field2.value = "T3";
}
}
HTML:
g***j
发帖数: 40861
7
来自主题: CS版 - perl 请教
是一个作业题
说一个CSV有四列,要求用perl 输出第一列和第四列。第四列或者是一个单词,或者是
两个单词。如果是两个单词,要求输出的时候这两个单词用双引号引起来。
下面是我写的perl
open(in_file," while ($line=)
{
($field1,$field2,$field3,$field4)=split',',$line;
if ($field4=~ /.\s./) {print "$field1, x\n";}
else {print "$field1,$field4";}
}
close (in_file);
我不知道怎么完成“如果是两个单词,要求输出的时候这两个单词用双引号引起来。
”这个任务,所以这里暂时用“x"代替了。
各位大侠,应该用什么代替“x"才能达到要求呢?
谢谢啊!
x**m
发帖数: 941
8
我的需求是在多个表的多个字段中进行全文查找, 像:
table1.field1 like '%keyword1%' AND table1.field1 like '%keyword2%'
OR table2.field1 like '%keyword1%'...
除了PostgreSQL的tsearch和OpenFTS, 还有没有方便点的东西?
谢谢.
l*******y
发帖数: 11
9
我的数据情况如下:
每个ID有多组重复测量的值,但是有的没有测量值
ID field1 field2 filed3
1
1 z
1 x y Null
2 a
2 Null b c
.
.
.
n
n e f
n d Null Null
想通过query得到每个field最后一个非空的数值,即:
ID field1 field2 filed3
1 x y z
2 a b c
...
n d e f
用total,last 得出的只能得到最后一组值:
ID field1 field2 filed3
1 x y Null
2 Null b c
n d Null Null
谢谢大家啦!
g***j
发帖数: 40861
10
来自主题: Xibei版 - 请教老乡 perl (转载)
【 以下文字转载自 Military 讨论区 】
发信人: gshjj (各输己键), 信区: Military
标 题: perl 请教 (转载)
发信站: BBS 未名空间站 (Tue Feb 2 15:33:24 2010, 美东)
发信人: gshjj (各输己键), 信区: CS
标 题: perl 请教
发信站: BBS 未名空间站 (Tue Feb 2 15:32:23 2010, 美东)
是一个作业题
说一个CSV有四列,要求用perl 输出第一列和第四列。第四列或者是一个单词,或者是
两个单词。如果是两个单词,要求输出的时候这两个单词用双引号引起来。
下面是我写的perl
open(in_file," while ($line=)
{
($field1,$field2,$field3,$field4)=split',',$line;
if ($field4=~ /.\s./) {print "$field1, x\n";}
else {print "$
n*****a
发帖数: 10
11
来自主题: Database版 - SORTING 中文 IN ORACLE
哪位大侠知道怎么SORTING 中文 IN ORACLE。 我试用
select field1 from globaltest where language
= 'Simplified Chinese' order by NLSSORT(field1,
'NLS_SORT=Chinese');
得到了一个ERROR,ORA-12702: invalid NLS parameter string
used in SQL function
先谢了
s*k
发帖数: 144
12
来自主题: Database版 - SORTING 中文 IN ORACLE

Oracle now only support binary sort for Eastern Languages
included Chinese.
So for Chinese try:
select field1 from globaltest where language
= 'Simplified Chinese' order by NLSSORT(field1,
'NLS_SORT=binary');
a****u
发帖数: 3
13
来自主题: Database版 - 一个有关查询的语句
我写了一个语句:select id from table1 as a inner join table2
as b on a.field1=b.field1 and a.field2 in (1,2) where
b.field2='str'
在sql server中通过了,但我想在access中使用,可能是inner join
出了问题,希望指教,谢谢!
c*****t
发帖数: 1
14
来自主题: Database版 - ACCESS问题, 请教!
我可以直接在“控件来源”(control source)里(FORM的一个FIELD)
直接用SQL语言吗?
就是敲入:
SELECT SUM(TABLE1.FIELD1)
FROM TABLE1
WHERE TABLE1.FIELD1= XXXXXX
谢谢!
fu
发帖数: 6
15
来自主题: Database版 - 一个SQL问题
今天interview被问倒一个SQL问题,GROUP BY 以后随机在每个GROUP选一行:
field1 field2 field3
A1 B1 C1
A1 B1 C2
A1 B2 C3
A1 B2 C4
A2 B3 C5
A2 B3 C6
A2 B4 C7
A2 B5 C8
要求GROUP field1 and field2, 每一个GROUP里随机的选一个C*, example
A1 B1 C1
A1 B2 C4
A2 B3 C5
A2 B4 C8
有谁知道怎么写SQL啊, 先谢了!
c**t
发帖数: 2744
16
来自主题: Database版 - Deadlock on merge (oracle)
no delete. Here is the pseduo scripts:
package ETL
function load_feed1
return LOAD.IMPORT('A')
end;
function load_feed2
return LOAD.IMPORT('B')
end
end ETL
package LOAD
function IMPORT(externalTable as varchar2) return number
MERGE INTO targetTable x using externalTable y
on x.key = y.key
WHEN MATCHED THEN UPDATE
set field = y.field
WHEN NOT MATCHED THEN INSERT
(field1, field2) values (y.field1, y.field2);
h***r
发帖数: 184
17
来自主题: Database版 - 新手请教:为什么这个Query不work
一个select query,criteria是field1等于1,field2是group by field3里最大的。
我写了下面的query,可是总告诉我最多只能return一个record,而在我的data set里
符合标准的应该有几百个才对。我用Access2007。请高人指点。
SELECT Table.*
FROM Table
WHERE Field1 = 1
AND Table.Field2 = (SELECT max(Field2) FROM Table GROUP BY Field3)
G***G
发帖数: 16778
18
来自主题: Database版 - statistics testing in oracle
one table as
field1 field2 field3 filed4
1 3 4 5
2 3 2 1
for each row, the formua is
field1!+field2!+field3+field!
N! means N*(N-1)*....*2*1
how to find the formuala for N! in oracle?
M**********n
发帖数: 4964
19
来自主题: Database版 - Sharepoint list怎么做sumif?
View #1:
Field1 Field2 Field3
ABC 1 0
ABC 1 1
ABC 0 0
DEF 1 1
View #2:
Field1 Field2 Field3
ABC 2 1
DEF 1 1
从view#1怎么到view#2?excel就很简单了,可没发现sharepoint view里面怎么直
接写sumif的?
谢谢。
w*s
发帖数: 7227
20
right now my query in c# looks like this,
Table1Entry bMfi = MyDB.Table1.Single(x => x.Name == "abc");
Table1 is like this {Name, field1, field2}.
now i break Table1 into 2 tables,
Table0 has {id, Name};
Table1 has {id, field1, field2}.
What's the easiest way to do a query based on Name now ?
c*********7
发帖数: 7607
21
来自主题: ebiz版 - nokia trade in又来了 问个问题

http://store.nokia.com/webapp/wcs/stores/servlet/productdetailb
minPrice=-1&langId=-1&productId=10000605&maxPrice=-
1&orderBy=PriceH&catalogId=10101&deviceSelected=Y&prodPage=true&
familyPageURL=
familyPage&beginIndex=0&field1=1&storeId=10500&pageSize=8&productPageURL=
produ
ctdetailbymodel&PhByMod=Y&ddkey=http:GOSPOnlineStoreHomeDisplay&cid=estore-
fw-
afc-na-con-na-linkshare-us-19-AffiliateDeepLink&siteID=mPPYFpj1vek-
MpaY44i6XUtrmI46nvD58Q
in stock again
h**k
发帖数: 662
22
要把一个access里的sql 转化到sql server.
在access
select tbl.field1 as field1x, "" as field2x into newtable.....
"" as field2x 部分怎么在SQL Server里面实现那?
l******o
发帖数: 279
23
来自主题: Immigration版 - My Outline of Contributions
我的 Outline of Contributions 就是这一项里小标题,是我自己加在律师写的PL里的
,再充实了一些内容。我觉得这样突出了重点,一目了然。可能跟其他PL里的模板区别
不大。不过如果能真正做到条理清楚、内容简洁、重点突出,基本上就没问题了。
I. Brief summary of credentials (one page)
A. Dr. XXX has contributed original scientific contributions of major
significance in the field (six and a half pages)
A.1 Dr. XXX is the first scientist to DO SOMETHING in FIELD1 with
programmable TECHNIQUE (Based on first-authored paper #1)
A.2 Dr. XXX independently developed the technology to fabricate SOMETHINGs
in FIELD2... 阅读全帖
y***l
发帖数: 1095
24
正打算写contribution这部分,看到模板有不同的写法,想问一下关于几个要点怎么分
配的问题。
我同事的1A RFE刚过不久,所以我本来是想按他RFE contribution部分来写的:
1. My original scientific research work has been published in top
scientific journals and conferences with very high impacts.
2. My original scientific research work has been selected to present orally
in the largest international conference in my field.
3. My original scientific research work has been widely cited in
publications on top scientific journals by experts in my field from leading
re... 阅读全帖
G***G
发帖数: 16778
25
来自主题: Fishing版 - 问个数据库问题,即删
want to create a table like this
select table1.*, count(distinct table1.field1) from table1
but it always pops up an error.
l********r
发帖数: 43
26
Group
Group A
A1 - UM A2 - North A3 - Pittsburgh
Group -B
B1 - MSU B2 - West B3 - OSU/Cleveland
Schedule
Field1 Field 2
9:30 A1 vs A2 B1 vs B2
11:30 A2 vs A3 B2 vs B3
1:30 A3 vs A1 B3 vs B1
3:30 2nd place of group A 2nd place of Group B
vs vs
3rd place of group B 3rd place of Group A
5:15 Championship Game
aw
发帖数: 127
27
来自主题: BuildingWeb版 - ASP SORT 一问.
不难。加6个HIDDEN INPUT FIELDS和一个VB SCRIPT FUNCTION就可以了。
FIELD1 用来存ORDERBY (PROJECT,。。。)
2-5分别存当前各FIELD的值,来回变(ASC,DESC)就行了。
在LINK上CALL SCRIPT FUNCIION来改变当前值。
不过你们现在的这种DESIGN不大好,换一种排序就得重新来回跑一次,用XML/XSLT好得多


这些FIELD


M**3
发帖数: 186
28
来自主题: CS版 - perl 请教
print "$field1, "$field"\n"
h**k
发帖数: 662
29
要把一个access里的sql 转化到sql server.
在access
select tbl.field1 as field1x, "" as field2x into newtable.....
"" as field2x 部分怎么在SQL Server里面实现那?
i****a
发帖数: 36252
30
select id, max(field1) as f1, max(field2) as f2
from table
group by id
B*********L
发帖数: 700
31
来自主题: Database版 - 新手请教:为什么这个Query不work

try this:
SELECT Table.*
FROM Table
WHERE Field1 = 1
AND Table.Field2 = (SELECT max(Field2) FROM Table)
B*****g
发帖数: 34098
32
来自主题: Database版 - 新手请教:为什么这个Query不work
SELECT t1.*
FROM Table t1
WHERE t1.Field1 = 1
AND t1.Field2 = (SELECT max(t2.Field2) FROM Table t2 where t2.Field3 =t1.
Field3 )
GROUP BY t1.Field3
g***l
发帖数: 18555
33
来自主题: Database版 - 新手请教:为什么这个Query不work
保险起见Access里写两个QUERY吧
QUERY1: SELECT FIELD3, MAX(FIELD2) AS MAXFIELD2 FROM TABLE GROUP BY FIELD3
QUERY2: T.* FROM QUERY1 Q1, TABLE T WHERE FIELD1=1
AND Q1.MAXFIELD2=T1.FIELD2 AND Q1.FIELD3=T.FIELD3
p*********d
发帖数: 136
34
来自主题: Database版 - 新手请教:为什么这个Query不work
BlueTigerBL 建议的
SELECT Table.*
FROM Table
WHERE Field1 = 1
AND Table.Field2 = (SELECT max(Field2) FROM Table)
应该 work 吧
w*m
发帖数: 1806
35
来自主题: Database版 - sqlloader
LOAD DATA
INFILE 'input_File.csv’
INTO TABLE tableName
FIELDS TERMINATED BY ","
(field1,
field2,
field3,
field4)
....
question: 可不可以在字段后面加上一个"select id from..."来自动赋值给某一字段?
b******t
发帖数: 10
36
来自主题: Database版 - how to remove fulltext index?
table里有
fulltext(field1,field2);
如何把这个index去掉啊?
试了 ALTER TABLE table DROP INDEX/FULLTEXT fields ... 啥的,都不行
p*a
发帖数: 592
37
from t0 in Table0
join t1 in Table1
on t0.id == t1.id
where
t0.Name == "abc"
select
new {t0.id, t1.field1, t1.field2};




while the controllers (action class) define where you can the backendData,
for example, SController.execute() would call SBusDelegate.getData()...
what UI framework u use?
b******y
发帖数: 1684
38
来自主题: Java版 - Question about Model 2
not sure what u r talking about.....
but let me try to answer...
basically for the data part, the jsp page would have things like

backendData.field1
backendData.field2
backendData.field3
c****1
发帖数: 302
39
不用什么dreamweaver的coldfusion。
首先搞清楚apache的数据结构
一般安装在xxx.../htdocs (如 /usr/local/apache/htdocs )
其实用Javascript, Java or Jsp都好,用php会更方便。
用php编写一个小文件如group_upload.php,它的内容是简单的form.
field1 :选择原文件在哪里
field2 :目标文件要放到哪里
group member premisson:Yes, or No
upload button(按这个就上传):这是关键,写一个function内部拷贝/上传文件
...
把group_upload.php放到/htdocs下或子目录/htdocs/yoursubfolder就行了
最好和mysql一起用,这样可方便排序和检索

member
cd
发帖数: 32
40
一个文件有多行, 每一行都是|隔开的多个field, 比如:
field1|field2|field3|field4|field5
对任何两行,如果前两field值一样,则认为是重复行。
请问如何重新输出一个文件,去掉这些重复行。
首先采纳的意见给包子 :-)
谢谢
cd
发帖数: 32
41
每行的field数一样,但是有些field可能是空 比如
field1|field2|field3||field5
o******y
发帖数: 12
42
来自主题: Programming版 - Java question
现在想用JAVA实现和远端通信,怎么定义message format on the wire.
For example, in C, the format is defined like this
struct CMD
{
uint16_t type;
uint16_t operation;
uint16_t field1;
uint16_t fields;
};
after populating this struct, I can call socket send to send out this
message.
In Java, What should I do to implement this ?
Thanks.
w*s
发帖数: 7227
43
来自主题: Programming版 - Python: how to do nested struct ?
say in c i have this
struct MyStruct {
struct MyHeader myHeader;
struct MyPayload myPayload;
};
struct MyHeader{
int id;
char name[MAX];
}
struct MyPayload {
int field1;
short field2;
.... // could be very long
}
what's the best ways in python pls ?
t***q
发帖数: 418
44
多谢,就一个post query这么简单吗?我也觉得不会很难。
主要就是要仿照那个例子,还是你觉得没必要。我install 了, web.py :
http://webpy.org/cookbook/restful_doctesting_using_request
然后,那个例子里还有一个 xml file,总之,最后希望 打开那个url 后,希望有一个
hash table, 例如用了如下命令后:
links http://localhost:8080/app?field1=sometitle
能打开这样一个file:
{"matched title": "XXXX", "confidence level": 0.95}
这样一个hash table
我用的是linux。
请问要实现这样的东西,有多难。多谢!
k**n
发帖数: 3989
45
来自主题: Programming版 - 这种需求用MongoDB如何做?
某种保险产品的查询,
用户输入
Field0=[1,2,3,4,5,6,7]
Field1=[10,20,40]
Field2=[2,3]
Field3=[1,2]
Field4 =true,
...
Field10=0,
value={v1=20,v2,v3..}
要求快速返回以上所有组合的结果。
应该如何设计shechma?
正常的json结构是. {_id,f1:10,f2:2,....f10:0,value:{v1,v2,v3}}
我是不是可以就跟做cache的key:value一样。把查询条件做成key?
每列
{_id:productid_f1_f2_f3_...f10,
value:{v1,v2,v3}
}
不清楚对mongo来说有没有必要这样做。
c**********5
发帖数: 653
46
来自主题: Statistics版 - 请教Macro(SAS)
Here is my sas code;
%macro va_111(field1,field2,new_var);
Data c;
merge mydata1 (in=a) mydata2;
by id;
if a;
%if &filed1=2 %then &new_var=0;
%else %if &filed2=" " and &filed1 =. %then &new_var=0;
%else &new_var=1;
run;
%mend;
%va_111(usuage,drugname,status);
Sas log:
WARNING: Apparent symbolic reference FILED1 not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition
where a numeric operand
is required. The condition was: (&filed1)=2
ERROR: The macr
h*e
发帖数: 10233
47
Dataset里有两个field (string),想看看field1是不是在field2中,要用哪个regular
expression function?多谢多谢
1 (共1页)