Hi!

Just want to ask if it's possible that within a select statement, there has a loop.

Have this sample query but when I run this it says missing expression after <column2>

Select <column1>, <column2>,
FOR  Lcntr IN 1..12
LOOP
        CASE WHEN Lcntr THEN
                ....
         END
END LOOP;
FROM <table>
WHERE <clause> 

Um. Not really. LOOP is for use in stored procedures, not in the context of SELECT statements.

I'm not really clear what you're trying to do here, honestly. Perhaps you could explain a bit more about what your intent is.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.