Home > Database > Mysql Tutorial > Oracle 与 SQL Server的简单常用的插入语句的区别

Oracle 与 SQL Server的简单常用的插入语句的区别

WBOY
Release: 2016-06-07 17:02:04
Original
1485 people have browsed it

--Oracle的方式判断记录是否存在不存在则插入---insert into a(a.user_id,a.user_name) select

Oracle 与 SQL Server的简单常用的插入语句的区别

[日期:2011-06-29] 来源:Linux社区  作者:w5q7c3 [字体:]

--Oracle的方式判断记录是否存在不存在则插入---
insert into a(a.user_id,a.user_name) select '2','李四' from dual where not exists
(select 1 from a where a.user_id='2')


--sql server的方式--
if not exists(select Test_TB.ID from Test_TB where)
  insert into Test_TB values('2','李四',GETDATE())

linux

  • 0
  • 解决在Oracle数据库中使用hibernate生成表不能正确创建表的问题

    Oracle EBS APP-MRP-22064: 出现内部错误 (mrlups_update_supply,,5)

    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