I'm running the following:

select if(substring(username,1,8)='cctcpin-', lcase(trim(leading
concat(substring_index(username,'-',1), '-') from username)),
lcase(username)), sec_to_time(sum(acctsessiontime)) as session from
radacct where acctstarttime between '2001-04-21' and '2001-05-21' and
acctstoptime group by username order by username;

which should return distinct usernames and their total monthly usage.  The
data comes out correct, it just looks like this:

| wilk
| 23:42:53  |
| will
| 19:51:16  |
| willyt
| 51:17:38  |
| wmoore
| 33:05:05  |
| wmp
| 13:44:10  |
| xlazyk
| 13:25:27  |
| ybarra
| 39:02:06  |
| zanew
| 02:57:12  |
| zboswell
| 44:38:06  |

Any ideas where the spaces or line return comes from?  It is not stored in
the table, as this looks fine:

mysql> select distinct(username) from radacct where username like 'cctc%'
order by username limit 5;
+------------------+
| username         |
+------------------+
| cctcpin-4707     |
| cctcpin-abennett |
| cctcpin-abetribe |
| cctcpin-ace4krn  |
| cctcpin-acres    |
+------------------+
5 rows in set (1.62 sec)

And to the text-based folks, my apologies for the ugly line wraps.  It
looks that bad in my pine session also.

Thanks,
-- 
===============================================
Kip Turk                    phone: 915.234.5678
Systems Administrator           or 800.695.9016
Killer of Spam/Writer of Code/Penguin Proponent
West Central Net              fax: 915.656.0071
===============================================


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to