I have a bit of a messy query to try figure out.
I have a column called "meta_value" and in that I have some HTML data such as:
-
Depending on how frequently you need to perform this and the size of the dataset, I would probably extract this data out in to a new table. I would create a table with pk, card_name (unique), count and then write a command in the application to iterate over the existing data to parse the out the names from the tag bodies or the data-name attribute in the html and create the row or update the count in the row, and then make the change in the application to make sure that column gets updated whenever meta_value changes.
Doing it this way and just sorting based on the count field will be more performant when for this specific lookup, but it will also make this query still be valid should the structure of your html ever change. It also allows for you at add other properties to these items
- 热议问题