Having and group by clause

Posts   
 
    
rparkins
User
Posts: 66
Joined: 04-May-2005
# Posted on: 14-Mar-2006 18:40:25   

Hi,

Implemented this in stored procedure, but looking for hints that let me use the internal llb collection objects and having clauses... Have checked the forum but cant quite get the correct code to do it.. The SQL I am trying to replicate is :

SELECT m.* FROM Stock as s, MainCategory as m where s.mc_id = m.mc_id and m.mc_active > 0 GROUP BY m.mc_id, m.mc_description, m.mc_order, m.mc_active HAVING COUNT( s.mc_id ) > 0

ie I want main categories that have stock, not a major query but having difficulties rage

Any help appreciated, I have placed a few questions on this forum and all answered and I think this tool is great and I hope as I use and implement some of these more complicated sql commands, I will reduce my use of this forum and maybe even help to answer some other questions... Many thanks

Richard

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 15-Mar-2006 02:19:19   

You'll need to do this using a dynamic list or typedlist that will allow a groupby with having clause. You can't do this with entities because the data is always grouped data, which thus isn't entity data.