What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-01 09:46:05
knex.raw in migrations file
knex('users') .select(knex.raw('count(*) as user_count, status')) .where(knex.raw(1)) .orWhere(knex.raw('status <> ?', [1])) .groupBy('status')Outputs:select count(*) as user_count, status from `users` where 1 or status <> 1 group by `... Add solution -
SQL 2021-09-29 17:55:02
loop through a table variable in TSQL without using a cursor
Declare @Id int While (Select Count(*) From ATable Where Processed = 0) > 0 Begin Select Top 1 @Id = Id From ATable Where Processed = 0 --Do some processing here Update ATable Set Processed = 1 Where Id = @Id End Add solution -
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5