getting error in sql: Every derived table must have its own alias -


need in fixing error,trying run query , getting error every derived table must have own alias, below code:

$sql="select trouble_type_priority, category_1, category_2, status, count(*) ( select distinct trouble_type_priority, category_1, category_2 tbl_main ) group trouble_type_priority,category_1,category_2 having count(*) > 1"; 

you need give subquery "alias", or name.

notice addition of a after subquery:

$sql="select trouble_type_priority, category_1, category_2, status, count(*) ( select distinct trouble_type_priority, category_1, category_2 tbl_main ) group trouble_type_priority,category_1,category_2 having count(*) > 1"; 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -