VSQL limit statement

Chris Jones cjones at daz3d.com
Fri Feb 25 17:54:43 CST 2011


I'm trying to do the following query:

SELECT **
FROM tblContent
LEFT JOIN tblContentInstance
ON tblContentInstance.fldContent = tblContent.RecID
WHERE tblContent.RecID IN (
                            SELECT tblContent.RecID
                            FROM tblContent
                            WHERE RecID IN (
                                SELECT fldContent
                                FROM tblContentKeyword
                                WHERE fldAssociation IN (
                                    SELECT RecID
                                    FROM tblKeyword
                                    WHERE fldKeyword LIKE '%Hiro%Toon%'
ESCAPE '*'
                                    )
                                )
                        )
ORDER BY tblContentInstance.fldFilename ASC LIMIT 12 OFFSET 0;

Its a bit convoluted I know, but the part that's causing me issues is the
"LIMIT 12 OFFSET 0".  In my test db this query yields exactly 12 results
without the limits.  I am executing this query repeately, changes the OFFSET
each time.  When I change the limit statement to "LIMIT 12 OFFSET 5" I get 7
results as I would expect, but if I do "LIMIT 12 OFFSET 12" I get 12 results
again.  Am I missing something about how limit works?

--Christopher Jones
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20110225/e6aab897/attachment.htm>


More information about the Valentina mailing list