Hi
I trying to use a simple subquery to find out the highest primary key in a table and print all of the results other than that one, but I keep getting a syntax error related to the subquery and I have no Idea why...
Does anybody know what I'm doing wrong?
Here is the code:
SELECT *
FROM sm_articles
WHERE articles_pk < (SELECT MAX(articles_pk) FROM sm_articles)
the table has 4 columns which are; articles_pk, articles_title, articles_date, articles_text.
Many thanks
I trying to use a simple subquery to find out the highest primary key in a table and print all of the results other than that one, but I keep getting a syntax error related to the subquery and I have no Idea why...
Does anybody know what I'm doing wrong?
Here is the code:
SELECT *
FROM sm_articles
WHERE articles_pk < (SELECT MAX(articles_pk) FROM sm_articles)
the table has 4 columns which are; articles_pk, articles_title, articles_date, articles_text.
Many thanks