As you can tell I am no sql guru. Is there anyway I could do the following without 'group by'.

query:
SELECT C.call_id, C.extn_no, C.dest, U.group_name
FROM call_data AS C, grp_user AS G, user_grp AS U
LEFT JOIN user_grp ON G.group_id = U.group_id
LEFT JOIN grp_user ON C.extn_no = G.extn_no
WHERE C.direction = 'Out'
AND C.extn_no IN (select extn_no FROM grp_user)
GROUP BY C.call_id, C.extn_no, C.dest, U.group_name


table data

call_data table
call_id |extn_no|dest |
1 |201 |012087562978|
2 |201 |079087562879|
3 |200 |018657562072|
4 |203 |018693263202|

user_grp table
group_id|group_name |
1 |ideal CT |

grp_user table
group_id|extn_no|
1 |200 |
1 |201 |

Lloydie T

Reply via email to