Need help with some complex SQL query

Posted by Psyche on Stack Overflow See other posts from Stack Overflow or by Psyche
Published on 2010-05-12T14:52:15Z Indexed on 2010/05/12 14:54 UTC
Read the original article Hit count: 135

Filed under:
|

Hello guys,

I need some help with a complex SQL query. Here's my setup: there are two tables, one with authors, and another with books. The books table contains a field named "author" which holds author's id. If a book has more than one author, then the "author" field will contain all the authors ids separated by ";" (something like 2;34;234).

On the website I have to list all the books written by an author. If there's only one author, its simple, but how can I get those books where the author I'm interested in is the second or third author?

Many thanks.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query