Im new to PHP, and even newer to PHP with MS SQL, not MySQL. After doing some research, I came up with what could be considered a pagination query to use, but obviously I’m going wrong somewhere because it throws an error. And I don’t understand why.
Heres the Query:
SELECT TOP 10 * FROM Products WHERE SubCatID = '".$scid."' and ProductID NOT IN ( SELECT TOP 0 * FROM Products ORDER BY ProductID ASC ) ORDER BY ProductID ASC
Heres the error:
Warning: mssql_query() [function.mssql-query]: message: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. (severity 16)
I understand it’s because of the sub-query, but can anyone just point me in the correct direction please?
You must select only one column inside the subquery. Example