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.
Related
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 3 years ago.
Improve this question
I have data from an sql query which i need to update in a table. Im saving the output of this query as a csv file. When i do load this file in sql though using the import export wizard, the data is all jumbled up as the columns have shifted in a lot of cases. So unrelated data is updated in many columns.
What could be the reason for this and please suggest a resolution.
Regards,
Priyesh
The obvious answer here is to use the insert into select syntax. If you have a query already that has generated data, insert it to where you want directly without saving to a CSV.
INSERT INTO target_table
SELECT * FROM your_original_query
If the issue is manually writing out most of the column names for a 150 column table, here is a trick. From within SSMS, click on the Columns folder of the table in question, and drag that to a new query window. You will get a list of all the column names for the table. (You could then remove the few that you do not need.)
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 4 years ago.
Improve this question
I know there are threads with the answer for this question but as a beginner I am having a really hard time understanding the difference between these two. I am learning Access and have not learnt about SQL statements yet. Most explanation to this question consists of SQL code that I do not understand. If you could explain the difference for a beginner that would be great.
If you have a combobox in your form, it will both have a row source and a control source. The control source is the field in the underlying table where the actual values are stored. The row source is the source of the list of values to select from.
Example: You got a table with flowers. One field is color. You want to limit which colors to enter for the flowers. The you make a table called flower_colors.
In your flower form, you then have a combobox. Its control source will be colors from the table flower and the row source will be flower_colors.
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 want to remove some special strings like ' in, at, on, a, an ,with... etc' from a search string in MySql.
eg-
select * from tbl_search where serachkey='best hotels in kerala';
I need to remove 'in' from string and need to look on database for best match, its somthing like google search.
I have one table with id,keys and parent_id.
The most scored parent_id should emit first.
Google Search is not an easy task to build.. but What you are in need of is Natural Language Processing.
Learn about OPEN NLP or Stanford NLP.
This will identify the parts of speech in a given sentence and you can manipulate further as per your needs.
You can also train a model for your needs.
Link for OpenNLP
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.
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.