How write a SQL statement to query the result set and display row as columns and columns as row?
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
- There is a table day_temp which has three columns dayid, day and temperature. How do I write a query to get the difference of temperature among each other for seven days of a week?
- How can I write an SQL query that lists a set of detail rows with a total at the bottom?
- How do I write a LINQ to Entities query which has the equivalent of the SQL "in" keyword?