Groups | Blog | Home
all groups > sql server mseq > september 2003 >

sql server mseq : Multiple SELECT statements - urgent



JenC
9/22/2003 1:03:49 AM
Hi,

I was wondering if anyone could help me. I need to return
a number of results from a table that require me to use
many select statements. i.e.

select count(NoApples) from fruitTable
where NoApples = -1 and Cost = 5

select count(NoOranges) from fruitTable
where NoOranges = -1 and Cost = 5

etc.....

The reason why I want to do this is because I need to
populate a crystal report which has between 24 and 60
fields and I dont realy want to do 24 to 60 separate
stored procedures per report.

I was thinking of using a user defined function to return
a table of the results, but I am having problems using
many select statements.

Any help/suggestions appreciated.

Thanks in advance.

Vishal Parkar
9/22/2003 2:01:59 PM
see reply in .programming

--
- Vishal

T.S.Ramesh
9/25/2003 1:14:32 AM
I feel there is some thing wrong in your database Design
itself. Why there are columns like NoApples, NOOranges
etc... The Design should have been this way, Fruits, No.
Where in you can store Apples, Oranges etc.. under Fruits
column and Noapples, NoOranges under No. column.
[quoted text, click to view]
AddThis Social Bookmark Button