i have two table tbl_category
id category
1 cat1
2 cat2
3 cat3
and second table Tbl_book
id cat_id book_name
1 1 book1
2 1 book2
3 2 book4
4 1 book5
i need query for pivot table
look like
category n1 n2 n3 n4 n5
cat1 book1 book2 book5 NULL NUll
cat2 book4 NULL NULL NULL NUll
Aucun commentaire:
Enregistrer un commentaire