Showing posts with label badly. Show all posts
Showing posts with label badly. Show all posts

Wednesday, March 21, 2012

help on comparing and modifying a resultset or table

HI everybody need help badly on the following

have to recordsets with the following with the following SQL

SELECT place, count(minus)as countminus
order by place
group by place

THE RESULT WOULD BE

PLACE countminus

ABC 10
DEF 50
HIJ 5
KLM 2
MNO 0

MY OTHER QUERY IS
SELECT plus, count(plus) as countplus
GROUP BY plus
ORDER BY plus

THE RESULT WOULD BE:

PLUS COUNTPLUS

ABC 10
DEF 20

my problem is i need to add another column to the first resultset (if possible) or create a table with the same field and values of the first result set with the additional column OF THE second resultset COUNTPLUS...

with this condition..

I need to loop with single row from the column PLACE on the first result set and compare it with the column PLUS on the second result set. if there is a value of the PLACE=PLUS get the corresponding value of the COLUMN COUNTPLUS AND WRITE it on the COUNTPLUS ON THE NEW TABLE.. ELSE THE VALUE IS 0 this i would do it up to the END OF FILE EOF...

THE RESULT WOULD BE THIS....

PLACE countminus COUNTPLUS

ABC 10 10
DEF 50 20
HIJ 5 0
KLM 2 0
MNO 0 0

I WAS WORKING ON THIS BUT COULDN'T GET THROUGH IT ANYTHING WOULD BE A BIG HELP FOR ME FROM YOU GUYSPLEASE STOP THINKING ABOUT LOOPS!!!! SQL DOESN'T WORK THAT WAY!!!!
select m.place
, m.countminus
, coalesce(p.countplus,0) as countplus
from (
select place
, count(minus) as countminus
from sometable1
group by place
) as m
left outer
join (
select plus
, count(plus) as countplus
from sometable2
group by plus
) as p
on p.plus = m.place|||thanks so much it solved my problem sorry for the loop frase i mentioned...

again thanks

Friday, February 24, 2012

Help me send BUG report to Microsoft

I wery badly speak english.
I want to send to microsoft sql server developers BUG report:
applies to:
Microsoft SQL Server 7.0 (all versions)
Microsoft SQL Server 2000 (all versions)
BUG repeatability:
all times
script for repeat the BUG
--
create table t (
id int primary key identity(1,1),
f int,
u varchar(128) not null default USER)
GO
create view v
as
select id, f
from t
where u = USER
GO
insert v (f)
select f
from t
group by f
GO
--
Error:
Server: Msg 8624, Level 16, State 9, Line 1
Internal SQL Server error.
Tnx in advance.
WBR, Roman S. GolubinJust wait a little time, Ill try something for your problem, be back soon.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Roman S. Golubin" <golubinr@.arhcity.ru> schrieb im Newsbeitrag
news:428c600a$1@.arhadm.net.ru...
>I wery badly speak english.
> I want to send to microsoft sql server developers BUG report:
> applies to:
> Microsoft SQL Server 7.0 (all versions)
> Microsoft SQL Server 2000 (all versions)
> BUG repeatability:
> all times
> script for repeat the BUG
> --
> create table t (
> id int primary key identity(1,1),
> f int,
> u varchar(128) not null default USER)
> GO
> create view v
> as
> select id, f
> from t
> where u = USER
> GO
> insert v (f)
> select f
> from t
> group by f
> GO
> --
> Error:
> Server: Msg 8624, Level 16, State 9, Line 1
> Internal SQL Server error.
>
> Tnx in advance.
> --
> WBR, Roman S. Golubin
>|||OK, to avoid questions to your case you have to mention the Computer
configuration (all), the service pack leel for OS and the SQL Server.
--
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> schrieb
im Newsbeitrag news:u71N9iFXFHA.712@.TK2MSFTNGP14.phx.gbl...
> Just wait a little time, Ill try something for your problem, be back
> soon.
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Roman S. Golubin" <golubinr@.arhcity.ru> schrieb im Newsbeitrag
> news:428c600a$1@.arhadm.net.ru...
>|||
> OK, to avoid questions to your case you have to mention the Computer
> configuration (all), the service pack leel for OS and the SQL Server.
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on
Windows NT 5.2 (Build 3790: )

Help me send BUG report to Microsoft

I wery badly speak english.
I want to send to microsoft sql server developers BUG report:
applies to:
Microsoft SQL Server 7.0 (all versions)
Microsoft SQL Server 2000 (all versions)
BUG repeatability:
all times
script for repeat the BUG
--
create table t (
id int primary key identity(1,1),
f int,
u varchar(128) not null default USER)
GO
create view v
as
select id, f
from t
where u = USER
GO
insert v (f)
select f
from t
group by f
GO
--
Error:
Server: Msg 8624, Level 16, State 9, Line 1
Internal SQL Server error.
Tnx in advance.
--
WBR, Roman S. GolubinJust wait a little time, I´ll try something for your problem, be back soon.
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Roman S. Golubin" <golubinr@.arhcity.ru> schrieb im Newsbeitrag
news:428c600a$1@.arhadm.net.ru...
>I wery badly speak english.
> I want to send to microsoft sql server developers BUG report:
> applies to:
> Microsoft SQL Server 7.0 (all versions)
> Microsoft SQL Server 2000 (all versions)
> BUG repeatability:
> all times
> script for repeat the BUG
> --
> create table t (
> id int primary key identity(1,1),
> f int,
> u varchar(128) not null default USER)
> GO
> create view v
> as
> select id, f
> from t
> where u = USER
> GO
> insert v (f)
> select f
> from t
> group by f
> GO
> --
> Error:
> Server: Msg 8624, Level 16, State 9, Line 1
> Internal SQL Server error.
>
> Tnx in advance.
> --
> WBR, Roman S. Golubin
>|||OK, to avoid questions to your case you have to mention the Computer
configuration (all), the service pack leel for OS and the SQL Server.
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Jens Süßmeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> schrieb
im Newsbeitrag news:u71N9iFXFHA.712@.TK2MSFTNGP14.phx.gbl...
> Just wait a little time, I´ll try something for your problem, be back
> soon.
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Roman S. Golubin" <golubinr@.arhcity.ru> schrieb im Newsbeitrag
> news:428c600a$1@.arhadm.net.ru...
>>I wery badly speak english.
>> I want to send to microsoft sql server developers BUG report:
>> applies to:
>> Microsoft SQL Server 7.0 (all versions)
>> Microsoft SQL Server 2000 (all versions)
>> BUG repeatability:
>> all times
>> script for repeat the BUG
>> --
>> create table t (
>> id int primary key identity(1,1),
>> f int,
>> u varchar(128) not null default USER)
>> GO
>> create view v
>> as
>> select id, f
>> from t
>> where u = USER
>> GO
>> insert v (f)
>> select f
>> from t
>> group by f
>> GO
>> --
>> Error:
>> Server: Msg 8624, Level 16, State 9, Line 1
>> Internal SQL Server error.
>>
>> Tnx in advance.
>> --
>> WBR, Roman S. Golubin
>>
>|||> OK, to avoid questions to your case you have to mention the Computer
> configuration (all), the service pack leel for OS and the SQL Server.
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on
Windows NT 5.2 (Build 3790: )

Help me send BUG report to Microsoft

I wery badly speak english.
I want to send to microsoft sql server developers BUG report:
applies to:
Microsoft SQL Server 7.0 (all versions)
Microsoft SQL Server 2000 (all versions)
BUG repeatability:
all times
script for repeat the BUG
create table t (
id int primary key identity(1,1),
f int,
u varchar(128) not null default USER)
GO
create view v
as
select id, f
from t
where u = USER
GO
insert v (f)
select f
from t
group by f
GO
Error:
Server: Msg 8624, Level 16, State 9, Line 1
Internal SQL Server error.
Tnx in advance.
WBR, Roman S. Golubin
Just wait a little time, Ill try something for your problem, be back soon.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Roman S. Golubin" <golubinr@.arhcity.ru> schrieb im Newsbeitrag
news:428c600a$1@.arhadm.net.ru...
>I wery badly speak english.
> I want to send to microsoft sql server developers BUG report:
> applies to:
> Microsoft SQL Server 7.0 (all versions)
> Microsoft SQL Server 2000 (all versions)
> BUG repeatability:
> all times
> script for repeat the BUG
> --
> create table t (
> id int primary key identity(1,1),
> f int,
> u varchar(128) not null default USER)
> GO
> create view v
> as
> select id, f
> from t
> where u = USER
> GO
> insert v (f)
> select f
> from t
> group by f
> GO
> --
> Error:
> Server: Msg 8624, Level 16, State 9, Line 1
> Internal SQL Server error.
>
> Tnx in advance.
> --
> WBR, Roman S. Golubin
>
|||OK, to avoid questions to your case you have to mention the Computer
configuration (all), the service pack leel for OS and the SQL Server.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> schrieb
im Newsbeitrag news:u71N9iFXFHA.712@.TK2MSFTNGP14.phx.gbl...
> Just wait a little time, Ill try something for your problem, be back
> soon.
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Roman S. Golubin" <golubinr@.arhcity.ru> schrieb im Newsbeitrag
> news:428c600a$1@.arhadm.net.ru...
>
|||
> OK, to avoid questions to your case you have to mention the Computer
> configuration (all), the service pack leel for OS and the SQL Server.
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on
Windows NT 5.2 (Build 3790: )