[..] > I will try and explain again what I am trying to do. > I read in a file with a list of > rooms....Then im trying to list the room once and then count > how many records match for the select statement and only > print the building once with a count in front of it.. > > db: > date build room dept > ## 211 30 22 > ## 211 30 22 > ## 444 50 05 > ## 1544 20 22 > ## 1544 20 22 > ## 333 30 22 > [..] > > My goal was to have this output: > For 30 : > 10BLD:211 > 1BLD:333 > For 20 : > 2BLD:1544 > > Thanks...... [..]
Hi Rob, as Wiggins already mentioned - I guess the easiest way to solve this is to let your database do the counting/grouping. Just send a statement like this to your database: SELECT count(*), build FROM Jun04 WHERE dept=22 and room=20 GROUP by build HTH, Philipp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>