Answer the question
In order to leave comments, you need to log in
How to write a SQL query correctly? Working with Like?
Get a
list of books written by 3 or more co-authors, indicating the number of authors (no names)
SELECT * FROM books WHERE authorId LIKE '% %, % %, % %'
Answer the question
In order to leave comments, you need to log in
select
(char_length(authorId) - char_length(replace(authorId,',','')) + 1) as author_cnt
,b.*
from books b
where (char_length(authorId) - char_length(replace(authorId,',','')) + 1) >= 3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question