Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How write a SQL statement to query the result set and display row as columns and columns as row?

columns display query row sql write
0
Posted

How write a SQL statement to query the result set and display row as columns and columns as row?

0

TRANSFORM Count (Roll_no) AS Count of Roll_no SELECT Academic_Status FROM tbl_enr_status GROUP BY Academic_Status PIVOT Curnt_status; Question: Cursor Syntax brief history Answer: To retrieve data with SQL one row at a time you need to use cursor processing. Not all relational databases support this, but many do. Here I show this in Oracle with PL/SQL, which is Procedural Language SQL .Cursor processing is done in several steps:1. Define the rows you want to retrieve. This is called declaring the cursor.2. Open the cursor. This activates the cursor and loads the data. Note that declaring the cursor doesn’t load data, opening the cursor does.3. Fetch the data into variables.4. Close the cursor.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123