Table 1: field name: Category
The value of 1: a, B 2:a,c

Table 2: field name: Category
Value: a

How to count the values in Table 2 of a in Table 1 several?
Similar to achieve
select count(1) Table 2 from where locate ('a'(select class from, table 2)) > 0, the function, how to achieve it?

Started by Alan at December 10, 2016 - 6:07 PM

Class select (select, count (*) from tb1 where category, =A. category)
from tb2 A

Posted by Caesar at December 21, 2016 - 6:16 PM

select count(*) Table 2 from where exists (select 1 from 1 where find_in_set (Table 2 categories, category))

Posted by Hamiltion at December 30, 2016 - 7:03 PM