How to sql question

This is a discussion on How to sql question within the informix forums in Other Databases category; select sum((select count(*) from srv zt, z where zt.some_id = z.sid union select count(*) from srv_arc yt, z where yt.some_id = zsid)) from systables where tabid=1 # ^ # 284: A subquery has returned not exactly one row. # Any suggestions on how to get this into the singleton select pls. Its part of a huge support type corruption detction statement, so the into temp is not an option. Table z has a couple of integers as a list of jobs to investigate....

Go Back   Database Forum > Other Databases > informix

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-18-2008, 09:09 AM
Default How to sql question

select sum((select count(*) from srv zt, z where zt.some_id = z.sid
union select count(*) from srv_arc yt, z where
yt.some_id = zsid))
from systables where tabid=1
# ^
# 284: A subquery has returned not exactly one row.
#


Any suggestions on how to get this into the singleton select pls.

Its part of a huge support type corruption detction statement, so the
" into temp " is not an option.

Table z has a couple of integers as a list of jobs to investigate.
Reply With Quote
  #2  
Old 08-18-2008, 09:18 AM
Default Re: How to sql question

select (select count(*) from srv zt, z where zt.some_id = z.sid) + (select
count(*) from srv_arc yt, z where
yt.some_id = zsid) as total
from systables where tabid = 1;

Art


On Mon, Aug 18, 2008 at 8:09 AM, ian wrote:

> select sum((select count(*) from srv zt, z where zt.some_id = z.sid
> union select count(*) from srv_arc yt, z where
> yt.some_id = zsid))
> from systables where tabid=1
> # ^
> # 284: A subquery has returned not exactly one row.
> #
>
>
> Any suggestions on how to get this into the singleton select pls.
>
> Its part of a huge support type corruption detction statement, so the
> " into temp " is not an option.
>
> Table z has a couple of integers as a list of jobs to investigate.
> _______________________________________________
> Informix-list mailing list
> Informix-list-at-iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>




--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art-at-iiug.org)

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do those
opinions reflect those of other individuals affiliated with any entity with
which I am affiliated nor those of the entities themselves.

Reply With Quote
  #3  
Old 08-26-2008, 09:30 AM
Default Re: How to sql question

Thanks Art
Talk about missing the bleedin obvious !
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 01:37 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.