0

When I do something like sql.prepare("SELECT * FROM raid WHERE raid1 > 0 AND NOT id='685337576810610734'").run(), does it return an array? How do I do this if I want to access each user independently who has raid1 > 0? Im not sure about the sql statement and Im not sure how to access each row individually one by one.

node.js

king
  • 127
  • 1
  • 7

1 Answers1

0

-- For eg. Creating two variables to store two column values

'DECLARE @column1 int, @column2 nvarchar(50);

-- Declaring cursor

'DECLARE raid_cursor CURSOR FOR
'SELECT col1, col2 FROM raid WHERE raid1 > 0 AND NOT id='685337576810610734';

'OPEN raid_cursor
'FETCH NEXT FROM raid_cursor
'INTO @column1, @column2

'WHILE @@FETCH_STATUS = 0
'BEGIN
-- Access each user individually 'END 'CLOSE raid_cursor --close cursor

Romancha KC
  • 1,507
  • 1
  • 13
  • 12