Feature #47812

Query support for BETWEEN

Added by Pascal Dürsteler over 7 years ago. Updated about 3 years ago.

Should have
Database API (Doctrine DBAL)
Target version:
Start date:
Due date:
% Done:


PHP Version:
Sprint Focus:


I would like to introduce the between-operator into the query class. This would allow shorter queries, and maybe a better performance for queries currently relying on two conditions.

So instead of

  $query->greaterThanOrEqual($propertyName, $operand),
  $query->lessThanOrEqual($propertyName, $operand)

One could simply write

  $query->between($propertyName, $minOperand, $maxOperand)

What do you think?

Related issues

Related to TYPO3 Core - Task #90794: Add between() method to QueryInterface Rejected 2020-03-20

Associated revisions

Revision 0fd91ff6 (diff)
Added by Morton Jonuschat about 5 years ago

[FEATURE] Extbase: Add between() operator to Query object

Support for ``between`` has been added to the Extbase Query object.
As there is no performance advantage to using BETWEEN on the DBMS
side (the query optimizers converts it to `min <= expr AND expr <= max)`
this method replicates the DBMS behaviour by building a logical AND
condition that has the advantage of working on all DBMS.

Resolves: #47812
Releases: master
Change-Id: Ic3b416515eedc651faf69de1db21eab288a8ad33
Reviewed-on: http://review.typo3.org/42813
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>


#1 Updated by Alexander Schnitzler over 7 years ago

  • Status changed from New to Needs Feedback

I just googled a bit and it seems there's no real difference in performance using between, in or "> <". So I think the underlying sql does not have to be adjusted but for sure the between constraint is a nice shortcut.

Unfortunetly I did not find the support in Flow so I will pass this on to my team mates to decide.

#2 Updated by Anja Leichsenring over 7 years ago

  • Target version set to Extbase 6.3

#3 Updated by Felix Oertel about 7 years ago

  • Assignee set to Tymoteusz Motylewski

Guess Xavier should tip us up with some hint about dbal (or other storage engines in general) supporting "between".

#4 Updated by Alexander Opitz about 6 years ago

  • Project changed from Extbase MVC Framework to TYPO3 Core
  • Category changed from Extbase: Generic Persistence to Extbase
  • Assignee changed from Tymoteusz Motylewski to Xavier Perseguers
  • Target version changed from Extbase 6.3 to 7.0

Hi Xavier,

it seams the question about "between" was for you.

#5 Updated by Xavier Perseguers about 6 years ago

  • Category changed from Extbase to Database API (Doctrine DBAL)
  • Status changed from Needs Feedback to New
  • Assignee deleted (Xavier Perseguers)

Would be a nice addition, for sure.

#6 Updated by Mathias Schreiber almost 6 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)

#7 Updated by Benni Mack over 5 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)

#8 Updated by Morton Jonuschat about 5 years ago

  • Assignee set to Morton Jonuschat
  • Target version changed from 7.4 (Backend) to 7.5

#9 Updated by Gerrit Code Review about 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42813

#10 Updated by Morton Jonuschat about 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#11 Updated by Riccardo De Contardi about 3 years ago

  • Status changed from Resolved to Closed

#12 Updated by Christian Eßl 7 months ago

  • Related to Task #90794: Add between() method to QueryInterface added

Also available in: Atom PDF