test

0

Please login or register to vote for this query.

(click on this box to dismiss)

Cardano Meta

Q&A for users and developers of the Cardano cryptocurrency ecosystem

declare @table1 table (Id int, description1 varchar(50), dt1 datetime2(0))
declare @table2 table (Id int, description2 varchar(50), dt2 datetime2(0))

declare @dt1 datetime2(0) = (select dateadd(mi, 100, getdate()))
declare @dt2 datetime2(0) = (select dateadd(mi, 50, getdate()))

insert into @table1
values 
(1, 'test1', @dt1),
(2, 'test2', @dt1),
(3, 'test2', @dt1)

insert into @table2
values 
(1, 'test21', @dt2),
(2, 'test22', @dt2),
(3, 'test22', @dt2)

select t1.*
      ,'***'
      ,t2.*
from   @table1 As t1
       LEFT OUTER JOIN @table2 t2 ON
         t1.id = t2.id

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results