Note that there are some explanatory texts on larger screens.

plurals
  1. POselect data with count of a phrase in sql
    text
    copied!<p>I have a table say EMPLOYEE and it has a column EMPLOYEE_NAME.<br> I want to see the phrases which comes in more than 5 records.<br> The phrase can be anything of 3 characters minimum. <br> For example, my table looks like this</p> <pre><code>EMPLOYEE_NAME User1 User2 User3 Client1 Client2 Client3 Use1 Aent1 Auser2 ent3 </code></pre> <p>I want to see 'Use' and 'ent' in the output since they have 5 or more records matching.<br> so basically I want to see the character sequences which have a length of 3 which appears anywhere in 5 or more records. <br> let me explain my scenario so that someone can think of a better solution than this. <br> I have a webservice which will hit a stored procedure in some db. <br> this webservice has a field(say employee name) where we can do wildcard search<br>this webservice also has another field where we can specify the maximum number of records in the output. <br>So if the search result for a particular phrase crosses that number I will get an error in the response.<br> I need to find the test data which can give me that error. <br> The query used in sp just puts % before and after the search phrase and returns all d matching records <br> I know the db, table and column which the sp uses and can run any query directly. <br>This query solution explained above was the only solution I could think of. <br>I haven't tried the answers below since it's already weekend, will try first thing next week. <br>But meanwhile if someone could give another better angle of finding the solution, it will be better. Any thoughts?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload