Question: For the attached query, i have written the below code. WITH BookCounts AS ( SELECT COUNT ( b . bookid ) AS Count, CONCAT (
For the attached query, i have written the below code.
WITH BookCounts AS
SELECT
COUNTbbookid AS Count,
CONCATafirstname, alastname AS AuthorName,
ppublishername AS PublisherName
FROM
Book b
JOIN
Author a ON bauthorid aauthorid
JOIN
Publisher p ON bpublisherid ppublisherid
GROUP BY
afirstname, alastname, ppublishername
HAVING
COUNTbbookid
SELECT FROM BookCounts
UNION ALL
SELECT AS Count, 'Thomas Cook' AS AuthorName, 'ABSPublisher' AS PublisherName;
This is my output:
COUNT AUTHORNAME PUBLISHERNAME
Harvey Deitel Prentice Hall
Harvey Deitel Prentice Hall PTG
Paul Deitel Prentice Hall
Sean Santry Prentice Hall
Tem Nieto Prentice Hall
Tem Nieto Prentice Hall PTG
Thomas Cook ABSPublisher
Still the testcase is failing, Can you please help to fix this,
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
