Welcome Guest, Not a member yet? Register   Sign In
how to do this mysql task?
#5

Here is the sql:
$sql = "CREATE TABLE survey_results_BC_temp
SELECT taxyear,user_email, item, campaign, email, qualified
FROM survey_results sr
WHERE item_type='BC' and campaign=?";
I'd like to have another column called number of employees which has the number of distinct. So I tried this:

SELECT taxyear,user_email, item, campaign, email, qualified, COUNT(distinct user_email) as number_of_employees
FROM survey_results sr
WHERE item_type='BC' and campaign=?
GROUP BY item, user_email

When I try running this interactively in MYSQL workbench I get no response.
proof that an old dog can learn new tricks
Reply


Messages In This Thread
how to do this mysql task? - by richb201 - 05-28-2021, 05:00 PM
RE: how to do this mysql task? - by InsiteFX - 05-29-2021, 04:47 AM
RE: how to do this mysql task? - by richb201 - 05-29-2021, 04:50 AM
RE: how to do this mysql task? - by InsiteFX - 05-29-2021, 05:22 AM
RE: how to do this mysql task? - by richb201 - 05-29-2021, 05:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB