Re: Sum/Join Query Building

2004-07-30 Thread Brent Baisley
Try adding DISTINCT to your query: SELECT DISTINCT I'm not sure if that's going to work in your case, but the problem you are having seems to be duplicate rows caused by joins. A left join will always return one or more rows from the main table (VPN). On Jul 30, 2004, at 9:47 AM, Alex wrote

Re: Sum/Join Query Building

2004-07-30 Thread SGreen
This has more to do with how JOINing tables work than making the sums work right. When you join tables, a new virtual table containing all possible combinations of rows from each of the tables is created. The ON clauses of each join limits which rows stay in the table (or get put into it in the

Re: Sum/Join Query Building

2004-07-30 Thread gerald_clark
Alex wrote: I'm having a problem with summing up joined tables.. can anyone help me? I have 3 tables that I am joining together vpn, dialup, and userinfo vpn has the following columns (This was a premade table so i couldn't change username into user_id to link with userinfo) username session_t

Sum/Join Query Building

2004-07-30 Thread Alex
I'm having a problem with summing up joined tables.. can anyone help me? I have 3 tables that I am joining together vpn, dialup, and userinfo vpn has the following columns (This was a premade table so i couldn't change username into user_id to link with userinfo) username session_time and oth