is it possible to create this query using the query designer?
Hi!
I'm trying the report query designer to see if it is possible to make a
report with this type of query.
I have a 'orders' table with the following data:
NAME TOTAL
Peter 400
James 500
Peter 400
Peter 300
John 500
John 200
Mariah 500
Mariah 200
Peter 100
Is it possible to design a query (using the Query Designer) like this?
SELECT
NAME
FROM
ORDERS
WHERE
SUM(TOTAL) > 1000
GROUP BY
NAME
I have tried to make the query using both the query designer and editing the
query manually, but I'm afraid I can't use functions in where clause.
Any other method to get this?
I'm using DBISAM 4 tables and RBuilder 11 Pro.
Thanks!
Santy C.
I'm trying the report query designer to see if it is possible to make a
report with this type of query.
I have a 'orders' table with the following data:
NAME TOTAL
Peter 400
James 500
Peter 400
Peter 300
John 500
John 200
Mariah 500
Mariah 200
Peter 100
Is it possible to design a query (using the Query Designer) like this?
SELECT
NAME
FROM
ORDERS
WHERE
SUM(TOTAL) > 1000
GROUP BY
NAME
I have tried to make the query using both the query designer and editing the
query manually, but I'm afraid I can't use functions in where clause.
Any other method to get this?
I'm using DBISAM 4 tables and RBuilder 11 Pro.
Thanks!
Santy C.
This discussion has been closed.
Comments
The RB 11 Query Designer has a new "Group Search" tab that supports
searching on aggregate calculations (i.e. SQL Having clause support).
In SQL, searching on an aggregate calculation can be performed in the Having
clause.
The SQL looks like..
Select Name
Sum(Total)
From Orders
Group By Name
Having Sum(Total) > 1000
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
use the Group Search feature.
http://www.digital-metaphors.com/rbWiki/DADE/Fundamentals/Group_Search_(Having_Clause)_Fundamentals
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com