What do you want to save?
Add Code snippet
New code examples
-
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 -
-
SQL 2021-09-26 20:48:03
sql limit to 5 results
-- MySql SELECT * FROM emp ORDER BY sal DESC LIMIT 5; -- SQL Server SELECT TOP 5 * FROM emp ORDER BY sal DESC; -- Oracle < 11g SELECT * FROM ( SELECT * FROM emp ORDER BY sal DESC ) WHERE ROWNUM <= 5; -- Oracle 12c + SELECT * FROM emp ORDER BY sa... Add solution -
SQL 2021-09-20 22:56:04
order by desc postgres
SELECT TOP 1 * FROM users ORDER BY id desc; Add solution -
Javascript 2021-09-07 03:41:04
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
(select TOP 1 [FileName] from [dbo].[APP_FinishProductCompleteForm_Attachment] where [finishProductID]=@FinishProductId and FileType='3' ) FileName3, (select TOP 1 [FileName] from [dbo].[APP_FinishProductCompleteForm_Attachment] where [finishProdu... Add solution
Best helpers
Ranking is empty