Arnes
Arnes

Reputation: 402

SQL Server equivalent in Oracle

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.

Upvotes: 1

Views: 554

Answers (1)

Devart
Devart

Reputation: 121902

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).

Upvotes: 1

Related Questions