2
Answers

how to select one table values greater then another table valuse using sql server

Photo of magesh manavalan

magesh manavalan

13y
1.6k
1

how to select one table values greater then another table valuse using sql server


for example Date of reg> Date of joining 



Date of reg varchar data type and Date of Joining Datetime data type.



Pls help me soon as possible


Answers (2)

0
Photo of Aarti
NA 1.6k 79.6k 13y
Hi Mangesh,


try with below script

select  distinct table1.* from table1 JOIN table2 on table1.id=table2.id where cast(date of reg as datetime)> (select distinct Date of joining from Table2)
0
Photo of Jaganathan Bantheswaran
NA 21.9k 2.2m 13y
Hi,

Select * from Table1 t1 inner join Table2 t2 on t1.reg > t2.join

before executing the above, convert the t1.reg to datetime.