Home > Database > Mysql Tutorial > sql编程的几个常识

sql编程的几个常识

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:56:53
Original
803 people have browsed it

sql编程的几个常识

1、@@ROWCOUNT可以判断上一行查询操作得到的列数;
2、给变量赋值用SET @Pr_id = 13;
3、察看是否有符合条件的记录IF EXISTS (Select name FROM sysobjects Where name = 'reminder' AND type = 'TR');

说明特别是第一个,感觉在写Proce的时候,可以好好的运用
Create Proc Add
@n char(10)
as
Select a from Table1 where a = @n
if(@@RowCount0)
Begin
Update ....
End
Else
Begin
Insert ..........
End
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template