Strings II - Manipulate Many Criteria


#1

Hi All,

What if I want to clean the ingredients column?

SELECT
REPLACE(ingredients,'enriched_',' ') as item_ingredients,
replace(ingredients,'_',' ') as item_ingredients

FROM
baked_goods;

Tried this, but the result is 2 columns.

How to combine it into 1 column?
Or to manipulate many criteria of strings in a column?

Thank you in advance.


#2

Maybe this helps
Step 8/9: Replace enriched_flour with just flour

 https://discuss.codecademy.com/t/step-8-9-replace-enriched-flour-with-just-flour/40025

#3
SELECT id, REPLACE(REPLACE(ingredients,'enriched_flour','flour'),'_',' ') as item_ingredients
from baked_goods;

Hi Leon, thank you for the link.
This one works, so is this the same concept with inner join?


#4

I do not understand the question
may this will help
P. 4 - Combine the albums and tracks tables using an INNER JOIN. Order the query by album_id
or
=for the near future=
PHP: 'While' loop skipping 'echo' when 'if' statement returns false


#5

Hi Leon, I mean to make all the underscore disappear and at the same time making other changes like enriched flour into flour, etc.

It’s ok, I grasp the concept now. Thank you. :slight_smile:


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.