Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What do I need to look for in this syntax error?

strong text

** I have been using the Chinook Database with SQLite to learn some SQL. The goal is to create a list of album titles and the unit prices for the artist "Audioslave". The "strong text" link will show the Chinook Database that I have been using to run this query.**

I have attempted to run this query using the concept of subqueries and I keep getting an error saying: near "SELECT": syntax error.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Here is the code that I have so far.

SELECT UnitPrice
FROM tracks
Where AlbumID IN 
    SELECT AlbumID
    FROM Albums
    Where AlbumID IN (SELECT Name
        FROM artists
            Where Name = 'Audioslave');

Any response would be appreciated 🙂

>Solution :

I think you are missing () after IN

SELECT UnitPrice
FROM tracks
Where AlbumID IN 
( SELECT AlbumID
    FROM Albums
    Where AlbumID IN (SELECT Name
        FROM artists
            Where Name = 'Audioslave'));
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading