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] >-----Original Message-----
>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.
>
>Jen
>.