sql
Veteran_
这个作者很懒,什么都没留下…
展开
-
where 条件查询 星等于
where a.number *=b.number这是一个有趣的查询条件,今天在存储过程中看到,不晓得*=是什么意思.最后同事说事左连接.写了段代码看看效果,表示比like 好用.附上测试语句select len(sch_id) from #studselect len(b.Sch_id) FROM tc_gradestd a,#stud cWHERE b.sch_id*=原创 2013-10-12 16:37:02 · 783 阅读 · 0 评论 -
sql判断字段是否存在
--判断要添加列的表中是否有主键 if exists(select 1 from sysobjects where parent_obj=object_id('tb') and xtype='PK') begin print '表中已经有主键,列只能做为普通列添加' --添加int类型的列,默认值为0 alter转载 2013-11-22 10:45:24 · 1603 阅读 · 0 评论