declare @ProductIds nvarchar(50)='18,19'
SELECT * FROM products Where (',' + @ProductIds +',' LIKE '%,' + CONVERT(VARCHAR, ProductId) + ',%')
SELECT * FROM products Where (',' + @ProductIds +',' LIKE '%,' + CONVERT(VARCHAR, ProductId) + ',%')
create table demo(
id int identity(1,1) not null,
alpha nvarchar(50)
)
insert into demo select 'A'
insert into demo select 'A'
insert into demo select 'A'
insert into demo select 'A'
insert into demo select 'A'
select * from demo
;WITH cte
AS (SELECT ROW_NUMBER() OVER (PARTITION BY alpha
ORDER BY ( SELECT 0)) RN
FROM demo)
DELETE FROM cte
WHERE RN > 1
select * from demo
declare @temp table
(
Id int identity(1,1) not null,
alpha nvarchar(50)
)
insert @temp select null
insert @temp select null
insert @temp select null
select * from @temp
declare @temp1 table
(
Id int identity(1,1) not null,
alpha nvarchar(50)
)
insert @temp1 select 'A'
insert @temp1 select 'B'
insert @temp1 select 'C'
select * from @temp1
update @temp set alpha=t1.alpha
FROM @temp as t inner join @temp1 as t1 ON t.id=t1.id
select * from @temp
hotel[] hotels= new [] { 10, 20, 10, 34, 113 };
declare @temp1 table
(
id int
)
insert into @temp1 select 1common table expression example to recursively increase the column Id. i think this is the most simple example of looping or recursion to print 1 to 10 with out printing each statement individually .... :)
;with cte Assql fiddle for this post can be find here sqlfiddle link
(
select id from @temp1
union all
select id+1 from cte where id<10 br="br"> )
select * from cte 10>
Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...