由买买提看人间百态

topics

全部话题 - 话题: testnames
1 (共1页)
g*********e
发帖数: 14401
1

比如
[testname:abc, time:123]
[testname:abc, time:222]
[testname:def, time:333]
group by testname以后 中间那个就没有了
g*********e
发帖数: 14401
2
比如我有类似
for (i =0; i connection(select... where testname=testnames[i]) function(rows, )...
...
}
最后我想把这些rows都Push到一个array里,然后用json得形式返回response。
但node里query 似乎是non blocking的?这种一般怎么解决?
g*********e
发帖数: 14401
3
i have an array, each of them is a string of a testname.
then a need to do a sql query "select ... where TESTNAME=testname ... " for
each tests, then collect each query result back and form the eventual
response.
[{test1: test1_query_result},
{test2: test2_query_result},
...
]
that's what i want. can anyone share usable code? Thx.
n****j
发帖数: 1708
4
SQL 没法给你这样的结果,只能是 table,select * from table where testname in
(n1,n2, ...) order by testname,然后在 node 里 foreach row , result[testname
].push({func,time})
s*****a
发帖数: 2006
5
来自主题: Chicago版 - 看看你前世有几个子女 (转载)
【 以下文字转载自 Joke 讨论区 】
发信人: csboy2007 (宇宙无敌包子控), 信区: Joke
标 题: 看看你前世有几个子女 (转载)
发信站: BBS 未名空间站 (Fri Oct 1 16:58:46 2010, 美东)
发信人: zhanqixiong (詹其雄), 信区: WaterWorld
标 题: 看看你前世有几个子女
发信站: BBS 未名空间站 (Fri Oct 1 15:12:53 2010, 美东)
http://cn.testname.cc/testname/cn/history/
h*********6
发帖数: 2469
6
来自主题: LosAngeles版 - 看看你前世有几个子女 (转载)
【 以下文字转载自 WaterWorld 讨论区 】
发信人: zhanqixiong (詹其雄), 信区: WaterWorld
标 题: 看看你前世有几个子女
发信站: BBS 未名空间站 (Fri Oct 1 15:12:53 2010, 美东)
http://cn.testname.cc/testname/cn/history/
V*****8
发帖数: 33122
7
来自主题: NewYork版 - 看看你前世有几个子女 (转载)
【 以下文字转载自 Joke 讨论区 】
发信人: csboy2007 (宇宙无敌包子控), 信区: Joke
标 题: 看看你前世有几个子女 (转载)
发信站: BBS 未名空间站 (Fri Oct 1 16:58:46 2010, 美东)
发信人: zhanqixiong (詹其雄), 信区: WaterWorld
标 题: 看看你前世有几个子女
发信站: BBS 未名空间站 (Fri Oct 1 15:12:53 2010, 美东)
http://cn.testname.cc/testname/cn/history/
S******s
发帖数: 5376
8
【 以下文字转载自 WaterWorld 讨论区 】
发信人: zhanqixiong (詹其雄), 信区: WaterWorld
标 题: 看看你前世有几个子女
发信站: BBS 未名空间站 (Fri Oct 1 15:12:53 2010, 美东)
http://cn.testname.cc/testname/cn/history/
z*********g
发帖数: 408
c*******7
发帖数: 17225
10
【 以下文字转载自 WaterWorld 讨论区 】
发信人: zhanqixiong (詹其雄), 信区: WaterWorld
标 题: 看看你前世有几个子女
发信站: BBS 未名空间站 (Fri Oct 1 15:12:53 2010, 美东)
http://cn.testname.cc/testname/cn/history/
b********n
发帖数: 673
11
来自主题: NorthEast版 - 测试一下你的网名值多少钱?
蛮有趣的 测了的不要忘了来报个价
中文名字版 http://cn.testname.cc/
英文名字版 http://testname.cc
A*********u
发帖数: 8976
12
来自主题: NorthEast版 - 测试一下你的网名值多少钱?
AdvancedEdu
$31,456.39

蛮有趣的 测了的不要忘了来报个价
中文名字版 http://cn.testname.cc/
英文名字版 http://testname.cc
d****n
发帖数: 1637
13
var async = require('async')
async.map(testNames,
function processOneName(tname, cb){
connectionToEachDb(tname,
function (rows, err){
if (err){
return cb(err);
}
return cb( null, rows);
}
);
},
function allDone(err, results){
if (err) return console.log("A error:", err);
return results ; // results are in the order of your testNames if all
successed
}
);
//use async.mapLimit([], limits, function procEach(){}, functi... 阅读全帖
t*****e
发帖数: 3276
14
http://cn.testname.cc/worth.asp?name=txeagle
经本站专家鉴定,姓名
txeagle
的价值高达
$12,804.71
M****o
发帖数: 13571
d********f
发帖数: 43471
u*****o
发帖数: 1224
17
来自主题: JobHunting版 - 今天面试居然流泪了,
你还年轻啊,来日方长,肯定有报答他们的一天啊。。
LZ我想问一句,你说的test case怎么写,是指怎么写syntax:
比如说写test function的interface
void test(const* testname, int input1, int input2, int expected){}
还是说有什么case需要cover,比如input是负,是0,out of range。。
我一直很关心test engineer和sde有什么不同,正好你来讲这个问题。。你rp太好了啊
b**p
发帖数: 62
18
来自主题: Ohio版 - 请教考驾照的考题
各州样题,其实题目里面可能数字有变化,但是
总体来说,差不了太多。。。
你如过没有事情做,可以做来玩
纽约州
http://www.nydmv.state.ny.us/dmanual/default.html
俄勒冈州(共2套):
http://www.oregondmv.com/DriverLicensing/knowledgetest.htm
俄亥俄州的(只有一套):
http://www.bmv.ohio.gov/driver_license/samp_dl_test.htm
华盛顿州的中文驾驶手册
http://www.dol.wa.gov/ds/chinese.htm
英文的:http://www.dol.wa.gov/ds/Guide2003.pdf
美國加州汽車駕照中文考題扫描集
http://www.wowpicture.com/fromchinatousa_bbs/us_ca_dmv_cn_scan/dmv_test_scan_index.htm
交通规则笔试2-P3里的第19题应该是选第一个,不是第三个。
加洲驾照模拟题网址
http... 阅读全帖
M**s
发帖数: 1984
19
来自主题: BNU版 - 前世档案
http://cn.testname.cc/history/
发现没有一个说我好的。。。。
b********n
发帖数: 673
20
来自主题: NorthEast版 - [合集] 前世档案馆
☆─────────────────────────────────────☆
Mars (火星) 于 (Mon Jul 14 18:14:21 2008) 提到:
http://cn.testname.cc/history/
我竟然是蜀国祸国殃民盗墓贼。。。。
☆─────────────────────────────────────☆
itanium (itanium) 于 (Mon Jul 14 18:15:01 2008) 提到:
哈哈哈哈哈哈哈
☆─────────────────────────────────────☆
itanium (itanium) 于 (Mon Jul 14 18:15:48 2008) 提到:
前世: 唐朝谨小慎微铁匠
魅力: 8
名气: 4
子女: 2个儿子, 6个女儿
宠物: 一只喜欢抓老鼠的狗
........................
☆─────────────────────────────────────☆
buckeyefan (小背心) 于 (Mon Jul 1
A*********u
发帖数: 8976
21
来自主题: NorthEast版 - 前世档案馆
http://cn.testname.cc/history/
姓名: 高教
前世: 北宋厚脸皮师爷
魅力: 6
名气: 7
子女: 6个儿子, 2个女儿
宠物: 金龟子
b********n
发帖数: 673
22
来自主题: NorthEast版 - 未来新闻社
http://cn.testname.cc/future/
n*****t
发帖数: 22014
23
select where testname in (...)
或者 async.foreach
n*****t
发帖数: 22014
24
楼上二位 。。。技术讨论吧 。。。
async 是显然的,lock 我不认为是问题,单线程的。楼主的例子,testname 可能在两
次 query 中被 update,导致同一条记录被 push 几次,再考虑效率,select in 我觉
得是最好的办法。
初学者,表喷我。。。。。。
p*****2
发帖数: 21240
25

testname 可能在两
次 query 中被 update,导致同一条记录被 push 几次,
这个是什么意思?
p*****2
发帖数: 21240
26
为什么你assume别人会改db呢?
也许immutable的 至少testname我不感觉会被改来改去
p*****2
发帖数: 21240
27

那testnames也可能会变呀。
g*********e
发帖数: 14401
28

my table schema is like this:
[testname, function, time]
is it possible for sql to do nested results in single select?
desired result:
{testname1 {function11, time11;
function12, time12;
...}
testname2 {function21, time21;
function22, time22;
...}
testname3 {...}
}
g*********e
发帖数: 14401
29


in
testname
1 (共1页)