I never think that i am wonderful. But here are very little guru! I am so sorry, that the forum is the home of the programers of china. But why no guru is here. Probable the forum is for the beginer only. My problem just very simple. But no one can answer. I don't understand, because I am only very ordinary man and never was collage student. And you, greate part of you certainly was or is collage student and further more had learn about computer in the university. How can i say? you are clever? I'm sorry about such the university education! And infact I only a middle shcool student and beacuse I am very busy, I put the problem in here. And infact the problem is very simple. But nobody here can answer. In china there is a proverbe: known as known, unknown as unknown. I think why the IT enterprising is just so so? Becase you, you are muderer. I regards everyone respectly. But you let yourself not a gentleman!!
I never think that i am wonderful. But here are very little guru! I am so sorry, that the forum is the home of the programers of china. But why no guru is here. Probable the forum is for the beginer only. My problem just very simple. But no one can answer. I don't understand, because I am only very ordinary man and never was collage student. And you, greate part of you certainly was or is collage student and further more had learn about computer in the university. How can i say? you are clever? I'm sorry about such the university education! And infact I only a middle shcool student and beacuse I am very busy, I put the problem in here. And infact the problem is very simple. But nobody here can answer. In china there is a proverbe: known as known, unknown as unknown. I think why the IT enterprising is just so so? Becase you, you are muderer. I regards everyone respectly. But you let yourself not a gentleman!!
I never think that i am wonderful. But here are very little guru! I am so sorry, that the forum is the home of the programers of china. But why no guru is here. Probable the forum is for the beginer only. My problem just very simple. But no one can answer. I don't understand, because I am only very ordinary man and never was collage student. And you, greate part of you certainly was or is collage student and further more had learn about computer in the university. How can i say? you are clever? I'm sorry about such the university education! And infact I only a middle shcool student and beacuse I am very busy, I put the problem in here. And infact the problem is very simple. But nobody here can answer. In china there is a proverbe: known as known, unknown as unknown. I think why the IT enterprising is just so so? Becase you, you are muderer. I regards everyone respectly. But you let yourself not a gentleman!!
巴顿,这个问题早就回答过你了,可能因为我太菜了,所以你没有看我的答案 泰山:sql语句里面的isnull函数的定义跟vb里面不同,题目里的写法没错,不信可以查一下help这个sql语句的问题出在group by,having跟where的不同之处在于having是对group之后的形成的字段做判断,所以having既然引用COUNT(id),就必须在broup by里包含COUNT(id)。 其实仔细看一下出错信息,里面都有提示的。以下代码测试通过:SELECT entry_id FROM bp_v_ostor_lst WHERE isnull(ver_status,0) <> 9 GROUP BY bp_v_ostor_lst.entry_id, COUNT(id) HAVING COUNT(id)=0
回复人: fuxc(Michael) (2002-1-24 20:44:21) 得0分 巴顿,这个问题早就回答过你了,可能因为我太菜了,所以你没有看我的答案 泰山:sql语句里面的isnull函数的定义跟vb里面不同,题目里的写法没错,不信可以查一下help这个sql语句的问题出在group by,having跟where的不同之处在于having是对group之后的形成的字段做判断,所以having既然引用COUNT(id),就必须在broup by里包含COUNT(id)。 其实仔细看一下出错信息,里面都有提示的。以下代码测试通过:SELECT entry_id FROM bp_v_ostor_lst WHERE isnull(ver_status,0) <> 9 GROUP BY bp_v_ostor_lst.entry_id, COUNT(id) HAVING COUNT(id)=0 ******************************************************* ******************************************************* ******************************************************* ******************************************************* 你不懂就不要在此胡乱参乎,你这个能返回有效记录?亏你说得出口,回去和你父亲学修鞋最好! ******************************************************* ******************************************************* ******************************************************* *******************************************************
sorry!是我搞错了,我记得上次你提的问题中,HAVING 后面的条件是id,而不是COUNT(id),所问的是sql语句不通过,我的回答是在group by 后面加id,并且我是测试过的, 这次把这道题的根上次的混淆了,所以没有测试,想当然地直接写了答案,这次你的sql语法没问题,count是个分组函数,当然不能在group by里出现,是我写错了 我觉得你的sql语句有逻辑问题: 既然按照entry_id分组,那么count(id)代表的就是:当entry_id等于某值时的记录数 entry_id既然等于某值,那么肯定存在相应的记录,那么count(id)是不可能=0的。顺便说一句,我父亲也不会修鞋,我希望你能给我倒个歉!
你自己试试 我所要的实际是:SELECT entry_id FROM BP_V_OSTOR_LST WHERE entry_id NOT IN(SELECT entry_id FROM BP_V_OSTOR_LST WHERE ver_status <>9) 我是一时想不出来 并不是我不会写 你说这难 其实也不是很难 但是 你们这种不负责的回答有用吗?你可以试试你的与我的结果是否一样!!!!
SELECT entry_id FROM BP_V_OSTOR_LST WHERE ver_status = 9 试试看跟你的结果是否一样!!! 不明白你为什么要那样写而且,我是否回答得对,跟你是否要道歉完全是两码事!!!
不一样: SELECT entry_id FROM BP_V_OSTOR_HED WHERE entry_id NOT IN(SELECT entry_id FROM BP_V_OSTOR_LST WHERE ver_status <>9) 按你写的则是: SELECT entry_id FROM BP_V_OSTOR_HED WHERE entry_id IN(SELECT entry_id FROM BP_V_OSTOR_LST WHERE ver_status = 9) 我写错了, BP_V_OSTOR_LST 中是有重复的 有一个等于9 就行了 不是 要所有的都等于9才行!!!!
isnull的()应该是表达式,返回 Boolean 值,指出表达式是否不包含任何有效数据.
有结果则Count(ID)不会等于0。
语法当然没有问题。所以不会报错
我要的就是:
所有的记录按 entry_id 分组后, 组里的每一条记录都符合:isnull(ver_status,0) <> 9
也就是说,应当全是9,而不是其它!
也就是说,应当全是9,而不是其它! 查出来的应该全部不为9才对,怎么会全是9呢
Vegatable!!
报错了我找你干吗?
不知还有哪位高手愿意出手
My problem just very simple. But no one can answer. I don't understand, because I am only very ordinary man and never was collage student.
And you, greate part of you certainly was or is collage student and further more had learn about computer in the university. How can i say? you are clever?
I'm sorry about such the university education! And infact I only a middle shcool student and beacuse I am very busy, I put the problem in here.
And infact the problem is very simple. But nobody here can answer.
In china there is a proverbe: known as known, unknown as unknown.
I think why the IT enterprising is just so so? Becase you, you are muderer.
I regards everyone respectly. But you let yourself not a gentleman!!
My problem just very simple. But no one can answer. I don't understand, because I am only very ordinary man and never was collage student.
And you, greate part of you certainly was or is collage student and further more had learn about computer in the university. How can i say? you are clever?
I'm sorry about such the university education! And infact I only a middle shcool student and beacuse I am very busy, I put the problem in here.
And infact the problem is very simple. But nobody here can answer.
In china there is a proverbe: known as known, unknown as unknown.
I think why the IT enterprising is just so so? Becase you, you are muderer.
I regards everyone respectly. But you let yourself not a gentleman!!
My problem just very simple. But no one can answer. I don't understand, because I am only very ordinary man and never was collage student.
And you, greate part of you certainly was or is collage student and further more had learn about computer in the university. How can i say? you are clever?
I'm sorry about such the university education! And infact I only a middle shcool student and beacuse I am very busy, I put the problem in here.
And infact the problem is very simple. But nobody here can answer.
In china there is a proverbe: known as known, unknown as unknown.
I think why the IT enterprising is just so so? Becase you, you are muderer.
I regards everyone respectly. But you let yourself not a gentleman!!
泰山:sql语句里面的isnull函数的定义跟vb里面不同,题目里的写法没错,不信可以查一下help这个sql语句的问题出在group by,having跟where的不同之处在于having是对group之后的形成的字段做判断,所以having既然引用COUNT(id),就必须在broup by里包含COUNT(id)。
其实仔细看一下出错信息,里面都有提示的。以下代码测试通过:SELECT entry_id
FROM bp_v_ostor_lst
WHERE isnull(ver_status,0) <> 9
GROUP BY bp_v_ostor_lst.entry_id, COUNT(id)
HAVING COUNT(id)=0
巴顿,这个问题早就回答过你了,可能因为我太菜了,所以你没有看我的答案
泰山:sql语句里面的isnull函数的定义跟vb里面不同,题目里的写法没错,不信可以查一下help这个sql语句的问题出在group by,having跟where的不同之处在于having是对group之后的形成的字段做判断,所以having既然引用COUNT(id),就必须在broup by里包含COUNT(id)。
其实仔细看一下出错信息,里面都有提示的。以下代码测试通过:SELECT entry_id
FROM bp_v_ostor_lst
WHERE isnull(ver_status,0) <> 9
GROUP BY bp_v_ostor_lst.entry_id, COUNT(id)
HAVING COUNT(id)=0 *******************************************************
*******************************************************
*******************************************************
*******************************************************
你不懂就不要在此胡乱参乎,你这个能返回有效记录?亏你说得出口,回去和你父亲学修鞋最好!
*******************************************************
*******************************************************
*******************************************************
*******************************************************
这次把这道题的根上次的混淆了,所以没有测试,想当然地直接写了答案,这次你的sql语法没问题,count是个分组函数,当然不能在group by里出现,是我写错了
我觉得你的sql语句有逻辑问题:
既然按照entry_id分组,那么count(id)代表的就是:当entry_id等于某值时的记录数
entry_id既然等于某值,那么肯定存在相应的记录,那么count(id)是不可能=0的。顺便说一句,我父亲也不会修鞋,我希望你能给我倒个歉!
做人与做学问是一样的
象dbcontrols对种唯分是图,
我绝不会再让他在此继续坑害下去!!!!!!!!!!!!!
决心已下
谁也别想拦!!!
我所要的实际是:SELECT entry_id FROM BP_V_OSTOR_LST
WHERE entry_id NOT IN(SELECT entry_id
FROM BP_V_OSTOR_LST WHERE ver_status <>9) 我是一时想不出来
并不是我不会写
你说这难
其实也不是很难
但是
你们这种不负责的回答有用吗?你可以试试你的与我的结果是否一样!!!!
试试看跟你的结果是否一样!!!
不明白你为什么要那样写而且,我是否回答得对,跟你是否要道歉完全是两码事!!!
SELECT entry_id FROM BP_V_OSTOR_HED
WHERE entry_id NOT IN(SELECT entry_id
FROM BP_V_OSTOR_LST WHERE ver_status <>9) 按你写的则是:
SELECT entry_id FROM BP_V_OSTOR_HED
WHERE entry_id IN(SELECT entry_id
FROM BP_V_OSTOR_LST WHERE ver_status = 9) 我写错了,
BP_V_OSTOR_LST 中是有重复的
有一个等于9
就行了
不是
要所有的都等于9才行!!!!
然后你的火爆脾气自己也应该注意一下。