In SQL Server we can use this:
DECLARE @variable INT;
SELECT @variable= mycolumn from myTable;
How can I do the same in Oracle? I’m currently attempting the following:
DECLARE COMPID VARCHAR2(20);
SELECT companyid INTO COMPID from app where appid='90' and rownum=1;
Why this is not working?

SELECT INTO
Make sure that the query only returns a single row: