SELECT book.BookTitle, author.Name, author.Surname, book.YearofPublication FROM book LEFT JOIN author ON book.AuthorID = author.AuthorID;
Enter image description here
This is my current table, I need to create a calculated field to tell me how many years this book has been published, but my brain is broken. Can anyone help?
I tried using xaamp query but didn't see the option.
P粉2880690452023-09-08 12:43:50
Try this:
SELECT book.BookTitle, author.Name, author.Surname, book.YearofPublication , YEAR(NOW()) - book.YearofPublication FROM book LEFT JOIN author ON book.AuthorID = author.AuthorID;