sql - Cursor in While loop -


My cursor and output

  Anosiatti set @ Vender_aidi Int @ Vender_nam Nvrekr (50 ) DECLARE @subvendor_id int, @subvendor_name nvarchar (50) print -------- vendor product report -------- to "choose Open from the cursor * MYSEQ for cursor vend_cursor vend_cursor forward FETCH In @Vendor_id, @vendor_name WHILE @@ FETCH_STATUS = 0 Print '' - Announce an internal cursor - on the basis of the seller with an external cursor. Select the cursor selector * Open MYSEQ from product_cursor FETCH next product_cursor @ subvendor_id, @ subvendor_name WHILE @@ FETCH_STATUS = 0 if IF (@subvendor_id & gt; 3) MYSEQ from SELECT * where Skyuelaidi = @ subvendor_id FETCH next product_cursor get @ Subvendor_id, @ subvendor_name and close product_cursor DEALLOCATE product_cursor - next vendor quiz  

question

I find the answers to many line values ​​I

  4 text4 5 text5  

(besides this there should not be duplicate records)

Edit: Val Sampling Query I need to do several situations, this is the reason I wrote this way.

Edit cursor

I need a record of overlapping records ...

 < code> Roiaid, Czech in, checkout 1 10 aM 2 PM 2 10:30 aM 11:30 aM 3 8 aM to 9 aM  

I only want to select overlapping records and also how many overlapping pair ... that I why I called for multiple cursors

Istema of Karsron SQL For now, forget ...

In any language, why would you declare an internal loop to repeat like an external loop? In this case both the cursors are based on the SELECT * MYME .


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -