我有一个用户表member
在每次insert 新的用户是检查 member表中是否存在相同的用户名 M_id
如果该用户名不存在 则 insert
insert into member (M_id,M_pwd,M_email)
while
not exist ?///
select * from member while M_id=‘id’
呵呵,就是这个意思,没怎么接触过sql 请指教。
------解决方案--------------------
if not exists(select 1 from member where [email protected])
insert member(M_id,M_pwd,M_email)
values(@M_id,@M_pwd,@M_email)
------解决方案--------------------
if m_id not in (select m_id from member )
insert member(m_id,m_pwd,m_email) values(value1,value2,value3)