1

I'm new in Oracle database. What I need is equivalent query in Oracle like this example from SQL Server (reading results in Management Studio). On Oracle side, I'm using Golden6 from Benthic Software.

declare @n integer
set @n = 100;
select * from table where id >= @n and id <= @n + 50

Thank you.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
Arnes
  • 404
  • 1
  • 5
  • 20

1 Answers1

1

Try this one -

CREATE TABLE tbl (ID NUMBER);
INSERT INTO tbl VALUES (100);
INSERT INTO tbl VALUES (10);

DEFINE n = 100;

SELECT * 
FROM tbl 
WHERE id BETWEEN &n AND &n + 50;

proff

You can try to run this script in dbForge Studio for Oracle (trial or free express version).

Devart
  • 115,199
  • 22
  • 161
  • 180