2

I am pulling unstructured data from a source and I am trying to put in structured from in DB. To minimize the amount of overhead by bombarding my server with multiple queries, i was wondering if there is a way to do a complex query that: Searches a string for a regex pattern say A[0-9]G+ and add a new row in another table where row.column = found column from regex

3
  • 4
    You might want to provide some more info. Such as an example of your data and an example of the output you expect. Commented Jul 4, 2011 at 20:31
  • I guess what I really want is to SELECT the regex substrings from a column (there may be multiple). For example: User1 says Hey check out #hashtag1 #hashtag2 #hashtag3, i want 3 row returned: (user1,hashtag1) (user1,hashtag2), (user1,hashtag3) Commented Jul 5, 2011 at 14:08
  • Also you might want to state exactly how the data is getting to your MySql server. There might be better options than running regex in the database itself. Commented Jul 5, 2011 at 14:56

1 Answer 1

1

MySQL has an INSERT-SELECT statement that lets you combined a selection (as complex as you want, including regex) with an insertion into a table of whatever was selected.

http://dev.mysql.com/doc/refman/5.5/en/ansi-diff-select-into-table.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.