fukamachi / cl-dbi

Database independent interface for Common Lisp
206 stars 28 forks source link

Range of elements #63

Open asarch opened 4 years ago

asarch commented 4 years ago

How could I do this query (from PostgreSQL SQL dialect)?

SELECT * FROM student ORDER BY id DESC LIMIT (20-10+1) OFFSET 10;
asarch commented 4 years ago
(ql:quickload :sxql)

(select :*
  (from (:student))
  (order-by :id (:desc :id))
  (limit (- 20 (+ 10 1)))
  (offset 10))

P.S.

This questions was not for here, it was for SxQL.

Sorry, sorry.