0

In a table in my database I have a sentence. I am trying to parse t and construct the categories.

The dimensions of the Item is Height:200, Width:500. And it is in red color.

Height and width can take some standard integers [100, 200, 300, ...]

I want to break parse this sentence and cont how many Items are of height 200 and width 500 and how many are of height 200 and width 300. so on..

I know we have to use regular expression and extract the needed info. I dont have much luck in finding any standard resource on how to parse out this data from the sentence in mysql. In java/any other program language I can do that but sql is not my strength. Any help or pointers is very appreciated.

3
  • 1
    Don't store the data like that. Have a column each for height, width and color instead. If you need to display that in a sentence then it's much easier to construct a sentence from the single values that to extract them from a sentence. Commented May 17, 2020 at 3:43
  • @sticky, when I saw the data my assumption was that the OP had a bunch of text (say) she wanted to analyze, so she just dumped it to a database, though it could be done by just processing strings instead. I doubt that she intends to store heights and widths that way! Commented May 17, 2020 at 3:55
  • regex101.com/r/wc5f0x/1 can you check this regex? Commented May 17, 2020 at 21:36

0

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.