mysql - Count only unique terms based on inner SELECT JOIN -
I'm just trying to calculate unique words as a total number.
This is the original query and it works fine
- & gt; Select ('DISTINCT search_tags.term AS t_name, nbr', FALSE) - & gt; From ('search_tags LEFT JOIN (SELECT term as tk, COUNT (search_tags .term) AS NBR FRI search_tag_tag_groups Search_TagTerms) Search_tag on SR SearchTROM = TR.TK') - & gt; Where ('search_tags.dt_added & gt; =', '2011-08-01 09:48:54') - & gt; Where ('search_tags.dt_added & lt; =', '2011-09-02 09:48:54'); // Returns: [Twitter, 12], [Facebook, 6] ..... The thing is that this code runs a datatylet (datatable.net) so that the data labels are removed Go to the selected line and change it to:
select COUNT (*) LEFT JOIN (from search_tags as numrows (word T, COUNT) (select as search_tags.term) As SR by search_tags.term from the search_tags group) as SR on search_tag.TRM = TR.kk) where `search_tag`.` `Dt_dad``> gt; '2011-08-01 09:48:54' and `search_tag` `Dt_dad`` So data formats can count the rows and it can be used as page rotation as the ultimate.
But when it takes out the selection, it gets all the rows because DISTINCT is not there anymore.
I'm deprived of gold, so I'm stuck trying and error forever. Please help lol: p
resolve
-> Selection ('DISTINCT st5.term as T_name, n_ocurrences', FALSE) - & gt; (From "ST4" as the search_tags, select the correct external JOIN (DISTINCT st.term, as the n_ocurrences from search_tags, ST JOIN (duration n_term, COUNT), as st2.term by ST2 Group As search_tags) as st3.n_term = st.term on st3.n_term = st.term where st_t_added> = '$ min' and st.dt_added & lt; = '$ max') on n_ocurrences st3 as st5 on st5.term In = 1 "); Some installation was selected to get the right amount to add. Now I need to count the unique n_ocurrences under $ min, returning the max number as the n_ocurrences only the entire number.
Comments
Post a Comment