Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a table(A) which contains texts(there is no any text length limitation and text counts can be more than 2000) and another table(B), which contains maximum 2000 static words.
I need to find occurrences of words from table B in texts of table A. And now, I am thinking about 2 possible solutions:
Store the words of table A in array and apply Knuth-Moriss-Prat algorithm to find occurrences.
Store the words of table A in array and use SQL "WHERE" condition to find occurrences.
Which method would you suggest for such kind of problem?
Store the b words in a hash table, then look up each A word in it.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am trying to join an old sql table with a new one but exclude the duplicate entries, this needs to be in a delphi program as well, and im a noob at that, any ideas?
These both keywords will make your data to combine and display in a single column.
Union - Removes the duplicate entries of the table
Union All - Includes the duplicate entries
It would be better if you provide an example with input and output, that would clarify your question the most.
you can use the union all operator instead of the union operator for joining two tables that not remove duplicates from the table.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a table named 'tweet' and its column 'text'. The column contains a sentence (many words) in each record. Then I wanna search the most word from the column. Is that possible to do that in MySQL query? If so, then I want to know also to add exception words like: 'a', 'I', etc...
I thought it's similar with this post
But it's using PHP.
I very appreciate for any help!
SQL is not the obvious tool for something like this. But, if you are going to use SQL, I would suggest that you parse the text into a TweetWords table, with one row per "tweet" and word in the tweet (along with position information).
If you are inserting the data through PHP, you can do the parsing there and then insert each word independently.
Then the count is easy, using a basic aggregation query.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I was wondering if anyone knows how to write a SELECT statement for SQLite to get all names from, lets say a teacher column, but only once. So lets say in the teacher column...Mr. Smith shows up several times, mrs. Jones shows up several times, how can I get a list of all the teachers names, but only once? Not lots of objects of the same name.
You can use the DISTINCT keyword to remove duplicates from the result
SELECT DISTINCT teacher_name FROM teacher
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
This is more of a theoretical question. Suppose we have a MySQL DB with n number of tables. Out of these m tables are possible to join (n-m tables cannot be joined on a key or won't even make any sense to join them). Given this; is there a finite number of MySQL queries possible for this DB and if so, how do we determine that number?
SQL is a constructive grammar and therefore has an limitless number of queries.
It doesn't matter how many tables are involved.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a two table first is simple primary key based table and second table is keyvaluepair for maintaining records.
Now I want to get records from Table in a single object. If they come as comma separate it's good.
Suppose I have table
ID valueID.
When I will run select query I not want a list of rows. I want a single column (in a row) that I can get the information about all valueIds.
Could someone explain me how can I get them in one instead of list?
You probably want to use GROUP_CONCAT.
SELECT GROUP_CONCAT(valueID) FROM table
http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat
If you need both the ID and the valueID, you're better off sticking with an array.