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.

Manikanta
  • 223
  • 3
  • 18
  • 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. – sticky bit May 17 '20 at 03: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! – Cary Swoveland May 17 '20 at 03:55
  • https://regex101.com/r/wc5f0x/1 can you check this regex? – Muhammad Numan May 17 '20 at 21:36

0 Answers0