Advertisement
elena1234

count separed with comma values in a column in MySQL

Feb 21st, 2023
1,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.32 KB | None | 0 0
  1.     SELECT
  2.            film.film_id,
  3.            film_actor.actor_id,
  4.            actor_award.awards,
  5.            LENGTH(actor_award.awards) - LENGTH(REPLACE(actor_award.awards, ',', '')) +  1 as total_award
  6.         FROM film
  7.         JOIN film_actor ON
  8.         film.film_id = film_actor.film_id
  9.         LEFT JOIN actor_award ON actor_award.actor_id = film_actor.actor_id
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement