mysql - SQL Query to insert into a particular column from output of select query -
i have query shown below:
select department departmentname,count(distinct(uid)) userscnt outlier_report department not null group department ;
i want insert outlier_output table populated , has 20 fields including departmentname , user_count (this field empty). want put userscnt field output of select outlier_output table department=outlier_report.departmentment_name
i assuming this:
insert outlier_output(user_count select department, count(distinct(uid) userscnt outlier_report department=outlier_report.departmentment_name)
how exact query be? in advance
standard insert-select format is:
insert `tablea` ([field_list]) select [results corresponding items in field list in same order field list] [etc...]
Comments
Post a Comment