I come from a sql server background. Frequently when trying to build some reports or answer questions from the database I would write queries that use a variable several times within the query. Rather than update the value 3-4 times each time I want to change the query I would use a variable so I can update the value only once. For brevity I have written a simple query below that illustrates what I would do in SQL Server when trying to pull a report.
declare @test numeric(3)
select @test = 683
select myColumn from myTable where myColumn = @test
What is the equivalent of this in oracle? I tried to write something similar but got some error messages about requiring an into statement. From what I can gather you can select something into a variable in oracle but you cant use a variable in a read only fashion like I have done above. Is it even possible to write a query similar to the one above in oracle?