由买买提看人间百态

topics

全部话题 - 话题: queries
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
m******u
发帖数: 12400
1
来自主题: Database版 - 这个query对么?
Finally I got this query. It works and is not ugly.
;with wCTE (ysd_id,ysd_temp,td_id, td_temp)
as(
select w1.id, w1.temp, w2.id, w2.temp
from weather w1
full join weather w2
on w1.id = w2.id -1
)
select weather.date
from weather
inner join wCTE
on wCTE.td_id = weather.id
where wCTE.td_temp > wCTE.ysd_tem
q*********8
发帖数: 188
2
以上的几个query结果应该相同。 Performance可以会有不同, 建议使用SQL Server自
带的Execution plan来看看如果优化。
d******y
发帖数: 244
3
来自主题: Database版 - SQL SERVER Query Help
googled find the query.
i********y
发帖数: 346
4
来自主题: Internet版 - failed to query TCP/IP
急问,在线等。本来上网好好的,用的comcast。但是电脑中病毒全部格式化重装之后
却无法上网了,用repair,却弹出来说failed to query TCP/IP,不知道是什么原因,哪
里的设置应该改动,请高人赐教。谢谢
s*****p
发帖数: 5342
5
来自主题: Java版 - Hibernate query
When I use hibernate, I found a problem. There are 4-5 tables which have one
-to-many in between. I have one object map to one table. The lowest and 2nd
lowest children level table have millions records. The top ones are just
hundreds at most. When I set search critia on both top and bottom level
table, the query is very slow. Something wrong with my implementation? Any
good suggestion?
3x!
s*****p
发帖数: 5342
6
来自主题: Java版 - Hibernate query
For your sample, I need add another table top on customer table, say state
for example. Assumely, one-to-many relationship is between state and
customer. It means one state has many customers. There is no relationship
between state and purchase.
Say, if I want to query how many states have male customer with pc purchases
over 1000, it seems hibernate use outer join to join all three tables and
return millions records with duplicated state name. If I use projection, it
is slow and also only retur
f*******4
发帖数: 345
7
来自主题: Java版 - Hibernate query
Can you post your code?
To simpily the question, say, you have a customer table which contains 100
rows,
each customer has thousands of purchases. the foreign key in customer table
is purchase_id which is the primary key of purchase table. What are your
mapping file and search query?
l*****b
发帖数: 82
8
I use Spring JdbcTemplate to do the following query and use RowMapper to get
the ResultSet. However, the Jboss server generate java.lang.
OutOfMemoryError some time.
SELECT *
FROM transactions
WHERE transaction_id = (SELECT refenence_tran_id FROM transactions WHERE
transaction_id = '1234')
or transaction_id = (SELECT original_transaction_id FROM transactions WHERE
transaction_id = '1234')
or original_transaction_id = '1234' or refenence_tran_id = '1234' order by
transaction_id
Notes:
1. The tabl
s********r
发帖数: 176
9
来自主题: Java版 - A Servlet query string question
Parameters are passed in the query string sent to the server side,
such as
http://localhost:9086/AppOn/order.do?OrderId=10000&custId=90000
It calls doGet() method to process the http request.
My question is there any disadvantage of doing that except that the length has the limitation of 250 characters-long and no confidential information?
Thanks a lot for your reply.
y****r
发帖数: 17
10
来自主题: Programming版 - 遇到一个比较棘手的SQL query,
【 以下文字转载自 Working 讨论区 】
发信人: yocker (no), 信区: Working
标 题: 遇到一个比较棘手的SQL query,
发信站: BBS 未名空间站 (Mon Jul 16 13:50:49 2007), 转信
有个table有三个字段如下:
===================
name city state
张三 ** **
李四
王二
......
==================
现在需要造出一个新的table/view
把同city,state的name挑出来,放在同一个row
例如:
name1,name2,name3......city, state
张三 李四 , 王二...... SF California
假设一个最大上限同city,state的names小于100.
即name1.....name100
n******7
发帖数: 12463
11
来自主题: Programming版 - 请教一个query CGI 的问题
需要用一个web server做点计算,但是它不支持batch query,所以写了一个python脚本
来递交查询
第一个server脚本是用post 传参数,还好
import urllib as ul
import urllib2 as ul2
url = 'xxx'
para = {'xx':xx,'yy':yy}
data = ul.urlencode(para)
req = ul2.Request(url, data)
response = ul2.urlopen(req)
从返回的html,可以提取两个内部id,id1和id2的值
第二个脚本用get,传递id1和id2两个参数的值
id1 = 145238
id2 = 153455
final_url = 'http://bioinformatics.clemson.edu/G-
SESAME/Program/geneCompareTwo3.php?id1=%s&id2=%s&Submit=submit' %
(id1,id2)
final_result = ul2.urlopen(final_url)
结果就总是不对,... 阅读全帖
t***q
发帖数: 418
12
多谢,就一个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。
请问要实现这样的东西,有多难。多谢!
W***o
发帖数: 6519
13
post query 就是让用户发送一个查询命令到服务器上,你服务器上执行搜索,返回结
果而已
我对python不是很熟

g*********e
发帖数: 14401
14
比如我有类似
for (i =0; i connection(select... where testname=testnames[i]) function(rows, )...
...
}
最后我想把这些rows都Push到一个array里,然后用json得形式返回response。
但node里query 似乎是non blocking的?这种一般怎么解决?
p*****2
发帖数: 21240
15

很简单呀。造一个array,每次query返回的时候检查array是否够数了,够了就返回了
n*****t
发帖数: 22014
16
楼上二位 。。。技术讨论吧 。。。
async 是显然的,lock 我不认为是问题,单线程的。楼主的例子,testname 可能在两
次 query 中被 update,导致同一条记录被 push 几次,再考虑效率,select in 我觉
得是最好的办法。
初学者,表喷我。。。。。。
p*****2
发帖数: 21240
17

testname 可能在两
次 query 中被 update,导致同一条记录被 push 几次,
这个是什么意思?
n*****t
发帖数: 22014
18
写程序的时候当然要考虑啊,即使现在没人update,你也不能保证将来没有,这不是马
工的基本素养吗?
就这个例子,最好的解决方案是 select in,一个 query 解决。其次是多条 select
into temp,一个 db connection。最后才是在 app 里面自己搞。
O****s
发帖数: 463
19
有没支持million concurrent queries per second的数据系统SQL/NoSQL?
去年淘宝双十一 每秒峰值是8.59万笔交易
如果每秒近百万级,什么系统可以实现?
ElasticSearch/SOlr?
N********n
发帖数: 8363
20

这是由QUERY性质决定的。不涉及耦合的QEURY跑10M/S也没问题。带耦合的
100K/S都费劲。淘宝那个是低耦合,卖药和卖鞋基本无耦合。很容易分流。
O****s
发帖数: 463
21
有没支持million concurrent queries per second的数据系统SQL/NoSQL?
去年淘宝双十一 每秒峰值是8.59万笔交易
如果每秒近百万级,什么系统可以实现?
ElasticSearch/SOlr?
N********n
发帖数: 8363
22

这是由QUERY性质决定的。不涉及耦合的QEURY跑10M/S也没问题。带耦合的
100K/S都费劲。淘宝那个是低耦合,卖药和卖鞋基本无耦合。很容易分流。
D**C
发帖数: 6754
23
来自主题: Programming版 - cassandra query speed求助
没,计算,全在内存,没多大。
我说的是从query开始到结束5秒
e*******o
发帖数: 4654
e*******o
发帖数: 4654
25
来自主题: Programming版 - Querying JSON in Postgres
把value 取出来在操作 query没问题吧
肯定没有mongo 方便是真的
w*s
发帖数: 7227
26
1. 网络前端输入第一个人的id,要查找几个人,然后在网页上显示。
比如说一次query:
8 John 53
11 Andy 44
23 Chris 21
2. 同时网页还有“下一页”这个键,你点击后直接从id 23开始查找。
最好的实现方法是什么?
k*******1
发帖数: 45
27
来自主题: Biology版 - FASEB J 投稿前的 Intial Query
实在理解不上去 在Initial Query准备须知中的这个内容, 请前辈们帮我看一下。
An abstract of no more than 200 words stating the PURPOSE(S)---PROCEDURES---
FINDINGS。 Then provide the rationale for the CONTROLS you have chosen.----
CONCLUSIONS.
Do not omit the controls, as cautioned in The FASEB Journal's August 2008
editorial, "Writing Science: The Abstract is Poetry, the Paper is Prose."
链接如下 http://www.fasebj.org/site/misc/iqprep.xhtml
这里的"CONTROLS" 该如何描述呢。 比如说我的试验是看药物A是否引起apoptosis,通
过哪个信号通路作用的, 没有动物实验。
ps 看了它给的那个关于CONTROLS... 阅读全帖
o*m
发帖数: 40
28
来自主题: Physics版 - prl状态求助,query to referee
各位版友好,lz投prl,现在第一轮审稿完成了,三个审稿人都已经给了editor回复,
本来以为可以等结果了,但昨天发现状态变为了query to referee,请问这是什么情况
?是吉是凶?
谢谢
o*m
发帖数: 40
29
来自主题: Physics版 - prl状态求助,query to referee
谢谢回复。状态如下:
06Aug14 Query to referee
10Jul14 04Aug14 Review request to referee; report received
10Jul14 03Aug14 Review request to referee; report received
10Jul14 28Jul14 Review request to referee; report received
24Jul14 25Jul14 Reminder to referee; response received
24Jul14 Reminder to referee [others sent (not shown) at 1-2 week
intervals]
10Jul14 Correspondence (miscellaneous) sent to author
10Jul14 Right to publish signature received
10Jul1... 阅读全帖
s****l
发帖数: 41
30
请教求职面试题:如何写一个SQL query求N行N列表中对角线的和
k*******1
发帖数: 45
31
来自主题: Science版 - FASEB J 投稿前的 Intial Query
实在理解不上去 在Initial Query准备须知中的这个内容, 请前辈们帮我看一下。
An abstract of no more than 200 words stating the PURPOSE(S)---PROCEDURES---
FINDINGS。 Then provide the rationale for the CONTROLS you have chosen.----
CONCLUSIONS.
Do not omit the controls, as cautioned in The FASEB Journal's August 2008
editorial, "Writing Science: The Abstract is Poetry, the Paper is Prose."
链接如下 http://www.fasebj.org/site/misc/iqprep.xhtml
这里的"CONTROLS" 该如何描述呢。 比如说我的试验是看药物A是否引起apoptosis,通
过哪个信号通路作用的, 没有动物实验。
ps 看了它给的那个关于CONTROLS... 阅读全帖
j***3
发帖数: 142
32
I have a table like this:
color size fruit
red big apple
red small apple
green big apple
yellow small orange
red small orange
when I do:
select color, size, count(*) group by color, size;
I got:
red big 1
red small 2
green big 1
yellow small 1
but what I need is to also return the NULL group count such as:
red big 1
red small 2
green big 1
green small 0
yellow small 0
yellow small 1
how I can do the query in mysql?
thank you all.
j***3
发帖数: 142
33
thank you RProgrammer (and smileguy, dapangmao again).
you guys are awesome !
I did not expect a simple query in mysql could go so complicated.
z**k
发帖数: 378
34
【 以下文字转载自 Database 讨论区 】
发信人: zerk (阿呆), 信区: Database
标 题: 请问:query about checking consistency
发信站: BBS 未名空间站 (Fri Jul 16 13:10:46 2010, 美东)
sorry i cannot type chinese at work.
I have a collection of records, ordered by date, the record has two other
attributes, say attr and prev, here's a simple example:
date, attr, prev
z**k
发帖数: 378
35
I hv hash index on ticker and date, as long as the data fits in ram, the
query could be done in linear time. I guess for large data set the
clustered tree index could greatly reduce disk io.
what's ur suggestion?

find
d**z
发帖数: 183
36
来自主题: Statistics版 - 如何把access query转成sas dataset?
用import导入,导入后的sas dataset有query中的variables,但是一个observation也
木有。。。请问是肿么回事啊。。
s*********y
发帖数: 34
37
想从SAS读取Oracle 里面 Table 或者 Query的结果, 里面数据量很大(~ 几万到几百万)
哪位大侠能给个SAS code. 担心这么大的数据读到SAS里面, 读的时候慢, 操作也起来
很慢.
e*****u
发帖数: 67
38
来自主题: Statistics版 - 這個SQL sub-query 是否畫蛇添足 ?
自學SQL query, 學到這個例子:
SELECT id, first_name
FROM student_details
WHERE first_name IN (SELECT first_name
FROM student_details
WHERE subject= 'Science');
source: http://beginner-sql-tutorial.com/sql-subquery.htm
為什麽不簡單這樣做, i,e why not -
SELECT id, first_name
FROM student_details
where subject= 'Science';
a******n
发帖数: 11246
39
来自主题: Statistics版 - 這個SQL sub-query 是否畫蛇添足 ?
其实还是楼主那句query更make sense。
比如
id first_name last_name subject
1 smith john science
2 smith david arts
书里那句会把两个人都选进来。。。
x******l
发帖数: 39
40
来自主题: Statistics版 - Oracle query 求助
I have a table a
ID | Name | City
1 |Jack | Null
2 |Tom | Null
And table b
ID | Name | City
1 |Jack | Dever
2 |Tom | Dallas
I need to write a query to join these two tables by id, name and city if
they are not null in table a. But any of these three column could be null
for each row.
I wrote one below but the performance is bad when data grows
Select * from a, b
Where (a.id is not null and a.id=b.id or a.id is null) and
(a.name is not null and a.name=b.name or a.name is null) and
(a.ci... 阅读全帖
d*b
发帖数: 21830
I**A
发帖数: 2345
42
来自主题: _PerfectMoms版 - 帮我看一下这个sql query
我又把自己绕糊涂了 (以前装的MYSQL又不知何处)。。
select d.dept_id, d.dept_name, count(*) as numemployees
from department d
left join employee e
where d.dept_id = e.dept_id
group by d.dept_id, d.dept_name
这个query返回的是
1 CS 0 (这儿是0麽????)
2 Physics 3
--------------------
department table
dept_id, dept_name
1, CS
2, Physics
Employee table
Emp_id, dept_id, Emp_name
001, 2, May
002, 2, June
003, 2, July
Left join 的结果应该是如下(还是应该还有一个column e.dept_id???)
d.dept_id, d.dept_name, e.emp_id, e.emp_name
1 CS
2
I**A
发帖数: 2345
43
来自主题: _PerfectMoms版 - 帮我看一下这个sql query
啊,对!你是对的。。
这个query结果是什么?
I*D
发帖数: 40035
44
来自主题: WashingtonDC版 - 诚聘 IT 英才---ZZ
Role Title Description Start Date End Date Status Level From
Level To Standard Role Work Location Role Specialty 1 Level 1
Role Specialty 1 Level 2 Role Specialty 1 Level 3 Role Specialty 1
Level 4 Role Specialty 1 Level 5 Skill & Proficiency
PeopleSoft Administrator This person will be part of a team that supports
a PeopleSoft Financial system with several associated custom applications
and batches using ASP .NET, Hyperion, PL/SQL, SQL, and SQR. This ... 阅读全帖
d**********0
发帖数: 44
45
来自主题: Stock版 - Bing搜索下三烂,太不要脸了
http://googleblog.blogspot.com/2011/02/microsofts-bing-uses-goo
Microsoft’s Bing uses Google search results—and denies it
By now, you may have read Danny Sullivan’s recent post: “Google: Bing is
Cheating, Copying Our Search Results” and heard Microsoft’s response, “We
do not copy Google's results.” However you define copying, the bottom line
is, these Bing results came directly from Google.
I’d like to give you some background and details of our experiments that
lead us to understand just how Bi... 阅读全帖
d**********0
发帖数: 44
46
来自主题: Stock版 - Bing搜索下三烂,太不要脸了
http://googleblog.blogspot.com/2011/02/microsofts-bing-uses-goo
Microsoft’s Bing uses Google search results—and denies it
By now, you may have read Danny Sullivan’s recent post: “Google: Bing is
Cheating, Copying Our Search Results” and heard Microsoft’s response, “We
do not copy Google's results.” However you define copying, the bottom line
is, these Bing results came directly from Google.
I’d like to give you some background and details of our experiments that
lead us to understand just how Bi... 阅读全帖
d**********0
发帖数: 44
47
来自主题: SanFrancisco版 - Bing搜索下三烂,太不要脸了
http://googleblog.blogspot.com/2011/02/microsofts-bing-uses-goo
Microsoft’s Bing uses Google search results—and denies it
By now, you may have read Danny Sullivan’s recent post: “Google: Bing is
Cheating, Copying Our Search Results” and heard Microsoft’s response, “We
do not copy Google's results.” However you define copying, the bottom line
is, these Bing results came directly from Google.
I’d like to give you some background and details of our experiments that
lead us to understand just how Bi... 阅读全帖
d**********0
发帖数: 44
48
来自主题: Seattle版 - Bing搜索下三烂,太不要脸了
http://googleblog.blogspot.com/2011/02/microsofts-bing-uses-goo
Microsoft’s Bing uses Google search results—and denies it
By now, you may have read Danny Sullivan’s recent post: “Google: Bing is
Cheating, Copying Our Search Results” and heard Microsoft’s response, “We
do not copy Google's results.” However you define copying, the bottom line
is, these Bing results came directly from Google.
I’d like to give you some background and details of our experiments that
lead us to understand just how Bi... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)