SQL Cursor value in single group -


I am using a SQL cursor. I want to select values ​​

Example: -

  while (@@ fetchstatus == 0) BEGIN (Choose Condom) rownumber, rowname to table end  

Answer: -

When I am getting value during the first phase of the loop execution.

1, "first" (from the row selection)

Next

2, "second line"

The output is displayed as individual rows. Is it possible to combine and display as two outputs in this way

1, "firsta"

2, "second line"

If you really need a loop on the cursor, it can be useful:

  - Create Temptable select top 0 rownumber, #temp table-loop from roverame while through your cursor (@@ fetchstatus == 0) BEGIN If start (cnd) start at #temp, select rowname from the table end Select END from rownumber, #temp drop #temp from rowname  

Comments

Popular posts from this blog

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

tsql - Correct sql/hql query (aggregate in where clause) -