Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Marja Ribbers #1
Getting recordcount from resultset of 'union' query
Hi,
I need to find out the number of records in the resultset of a union of 2 queries.
E.g.
"select ID from Pages where numPageCatID = " & p_iCatID & _
" and ID not in (1,2,3,4)" & _
" union" & _
" select ID from Pages" & _
" inner join UserCatPages on UserCatPages.numPageID = Pages.ID" & _
" where UserCatPages.numUserCatID in (12,3)"
I am now building a recordset and using l_oRs.GetRows() to get the number of records, and that works okay.
But is it possible to somehow use the Count() function in the SQL query above?
--
Marja Ribbers-de Vroed
Internet:
- [url]www.webwaresystems.nl[/url]
- [url]www.clubwebware.nl[/url]
- [url]www.flevooware.nl/dreamweaver[/url]
Marja Ribbers Guest
-
CFC Query not returning recordcount
I wrote a CFC that performs a simple query. After the CFC runs the query I try to check for the recordcount in the calling template and get the... -
return query resultset from custom tag
Hi, How to return an entire query resultset from custom tag to the calling page ? Thanks for your help. vmrao -
ORDER BY in UNION query
Hi, I need to use ORDER BY clause in a UNION query and the Order BY columns are not included in the SELECT statement. I tried like this (select... -
Sorting With a UNION Query?
Hey all, I'm working with SQL server 2000 (upsized from MS Access 2000) and I've been able to reconcile all my SQL differences but one. I build a... -
UNION QUERY
I've just installed version 4 of MySql and understand this may be a question regarding my syntax, not PHP, but I'm receiving errors from the... -
Kindler Chase #2
Re: Getting recordcount from resultset of 'union' query
Marja Ribbers wrote:
Marja,> Hi,
>
> I need to find out the number of records in the resultset of a union
> of 2 queries.
>
> E.g.
>
> "select ID from Pages where numPageCatID = " & p_iCatID & _
> " and ID not in (1,2,3,4)" & _
> " union" & _
> " select ID from Pages" & _
> " inner join UserCatPages on UserCatPages.numPageID = Pages.ID" & _
> " where UserCatPages.numUserCatID in (12,3)"
>
> I am now building a recordset and using l_oRs.GetRows() to get the
> number of records, and that works okay.
>
> But is it possible to somehow use the Count() function in the SQL
> query above?
Are you just trying to count the total records? Or are you trying to count
something more specific within the recordset? If just the total records,
use the UBound function (+1) once the records are brought into an array from
the GetRows function.
--
kindler chase
[url]http://www.ncubed.com[/url]
Home of SuperInvoice: The Online Invoicing Application.
Organize your billing process and impress your clients.
[url]news://news.ncubed.com/support[/url]
n3 Support Group
Kindler Chase Guest
-
Marja Ribbers #3
Re: Getting recordcount from resultset of 'union' query
Hi Kindler,
Yes, as I already mentioned I am currently using the GetRows() method (with the UBound() function).
But I was wondering if it could be done otherwise.
--
Marja Ribbers-de Vroed
Internet:
- [url]www.webwaresystems.nl[/url]
- [url]www.clubwebware.nl[/url]
- [url]www.flevooware.nl/dreamweaver[/url]
"Kindler Chase" <weaver@DELETEME_roubaixinteractive.com> wrote in message news:d5iv64$gf6$1@forums.macromedia.com...> Marja Ribbers wrote:>>> Hi,
>>
>> I need to find out the number of records in the resultset of a union
>> of 2 queries.
>>
>> E.g.
>>
>> "select ID from Pages where numPageCatID = " & p_iCatID & _
>> " and ID not in (1,2,3,4)" & _
>> " union" & _
>> " select ID from Pages" & _
>> " inner join UserCatPages on UserCatPages.numPageID = Pages.ID" & _
>> " where UserCatPages.numUserCatID in (12,3)"
>>
>> I am now building a recordset and using l_oRs.GetRows() to get the
>> number of records, and that works okay.
>>
>> But is it possible to somehow use the Count() function in the SQL
>> query above?
> Marja,
>
> Are you just trying to count the total records? Or are you trying to count
> something more specific within the recordset? If just the total records,
> use the UBound function (+1) once the records are brought into an array from
> the GetRows function.
>
> --
> kindler chase
> [url]http://www.ncubed.com[/url]
> Home of SuperInvoice: The Online Invoicing Application.
> Organize your billing process and impress your clients.
>
> [url]news://news.ncubed.com/support[/url]
> n3 Support Group
>
>Marja Ribbers Guest
-
Kindler Chase #4
Re: Getting recordcount from resultset of 'union' query
Marja Ribbers wrote:
Yes, it can be done. However, you'd have to create a sub-query and would be> Hi Kindler,
>
> Yes, as I already mentioned I am currently using the GetRows() method
> (with the UBound() function).
> But I was wondering if it could be done otherwise.
less efficient than using the UBound function.
--
kindler chase
[url]http://www.ncubed.com[/url]
Home of SuperInvoice: The Online Invoicing Application.
Organize your billing process and impress your clients.
[url]news://news.ncubed.com/support[/url]
n3 Support Group
Kindler Chase Guest



Reply With Quote

