I have a table similar to this in my application, i am trying to ignore the item "applefritter_demo_rasberry" because its just the sum of all the other items which has the same substring.
I am trying to write a mysql query (not an expert) to fetch all the values except "applefritter_demo_rasberry" which is nothing but a parent to these items and holds the total.
I've looked at the sub string using this post, but i couldn't grasp the logic behind this. Can some one suggest a way.
ID Recipe Value
164686 applefritter_demo_rasberry 140
164686 applefritter_demo_rasberry_cake 40
164686 applefritter_demo_rasberry_pudding 20
164686 applefritter_demo_rasberry_pie 10
164686 applefritter_demo_rasberry_bread 40
164686 applefritter_demo_rasberry_candy 20
164686 applefritter_demo_rasberry_juice 10
EDIT:
Just to add a bit more clarity to the question, the table is populated by an application, the application also inserted the parent recipe's total and its children's total. I have a requirement to identify the total of all the recipe's in the table, the table also contains standalone recipe (no parent) such as "ovenfresh_frenchbread" , during total calculation i want ignore all these parent items who end up being the substring of child items.