• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Selecting a row range from query of queries

New Here ,
Oct 14, 2019 Oct 14, 2019

Copy link to clipboard

Copied

Hi, is there a way to select a row range from query of query. I mean like an alternative for LIMIT and OFFSET in regular MySQL queries.

Views

337

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 15, 2019 Oct 15, 2019

Copy link to clipboard

Copied

According to the QoQ Help page, no.

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 16, 2019 Oct 16, 2019

Copy link to clipboard

Copied

Query of query doesn't have that. Nevertheless, if your query had a numerically ordered column, then you could filter using a clause like:

where productId between 27 and 89 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2019 Oct 16, 2019

Copy link to clipboard

Copied

LATEST

Depending on the underlying database you are using it is possible. In SQL Server, and I think My SQL, you can use the ROW_NUMBER() function to generate an incrementing sequence number for each row in the result set.

 

<cfquery name="q" datasource="DSN">
SELECT col1, col2,
ROW_NUMBER() OVER (ORDER BY col1) AS rownum
FROM myTable
</cfquery>

<cfquery name="qq" dbtype="query">
SELECT col1, col2, rownum
from q
where rownum between 20 and 30
</cfquery>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation