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
  • 732,580
  • 175
  • 1,330
  • 1,459
Arnes
  • 403
  • 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
  • 119,203
  • 23
  • 166
  • 186