select a.*,b.col_ckdh,b.col_ckck,b.outdate,b.col_gcbh from cuku_goodsinf as a inner join cuku_inf as b on a.col_ckdh=b.col_ckdh and convert(char(7),b.outdate,120)=‘2005-01’
select a.*,b.col_ckdh,b.col_ckck,b.outdate,b.col_gcbh from cuku_goodsinf as a inner join cuku_inf as b on a.col_ckdh=b.col_ckdh and convert(char(7),b.outdate,120)='2005-1'
update: select a.*,b.col_ckdh,b.col_ckck,b.outdate,b.col_gcbh from cuku_goodsinf as a inner join cuku_inf as b on a.col_ckdh=b.col_ckdh and convert(char(7),cast(b.outdate as datetime),120)='2005-01'
select a.*,b.col_ckdh,b.col_ckck,b.outdate,b.col_gcbh from cuku_goodsinf as a inner join cuku_inf as b on a.col_ckdh=b.col_ckdh and convert(char(7),cast(b.outdate as datetime),120)='2005-01'