Home Database Mysql Tutorial 数据库Oracle与SqlServer与Access

数据库Oracle与SqlServer与Access

Jun 07, 2016 pm 03:40 PM
access oracle sqlserver database time

1,时间: Access:now() SqlServer:getdate() oracle:sysdate() 2,游标: sqlserver: declare @id int declare rs cursor for select PdaId from Biz_Pda where PdaState = ' 1 ' or PdaState = ' 2 ' if @iPda = 1 begin open rs fetch next from rs into @id

1,时间:
Access:now()
SqlServer:getdate()
oracle:sysdate()
2,游标:
sqlserver:

数据库Oracle与SqlServer与Accessdeclare @id int
数据库Oracle与SqlServer与Access
declare rs cursor for select PdaId from Biz_Pda where PdaState='1' or PdaState='2' 
数据库Oracle与SqlServer与Access
if @iPda=1
数据库Oracle与SqlServer与Access
begin
数据库Oracle与SqlServer与Access 
open rs
数据库Oracle与SqlServer与Access 
fetch next from rs
数据库Oracle与SqlServer与Access 
into @id
数据库Oracle与SqlServer与Access 
while @@fetch_status=0
数据库Oracle与SqlServer与Access 
begin
数据库Oracle与SqlServer与Access  
--执行的操作
数据库Oracle与SqlServer与Access
 end
数据库Oracle与SqlServer与Access 
close rs
数据库Oracle与SqlServer与Access 
deallocate rs
数据库Oracle与SqlServer与Access
end

oracle:

数据库Oracle与SqlServer与Accessdeclare
数据库Oracle与SqlServer与Access  r_cert certrecord
%rowtype; 
数据库Oracle与SqlServer与Access  
cursor cs is select * from certrecord order by id;
数据库Oracle与SqlServer与Access
begin
数据库Oracle与SqlServer与Access    
open cs;
数据库Oracle与SqlServer与Access    loop
数据库Oracle与SqlServer与Access         
fetch cs into r_cert;
数据库Oracle与SqlServer与Access         
exit when cs%notfound;--没有数据退出
数据库Oracle与SqlServer与Access
        --执行的操作
数据库Oracle与SqlServer与Access
    end loop;
数据库Oracle与SqlServer与Access    
commit;--提交数据
数据库Oracle与SqlServer与Access
    close cs;
数据库Oracle与SqlServer与Access
end;


3,查询后赋给单个变量
sqlserver:

数据库Oracle与SqlServer与Accessselect @parameter=t.aa from table

oracle:

数据库Oracle与SqlServer与Accessselect t.aa into parameter from table

 

4,函数:

字符转换:

sqlserver:str(..)

oracle:to_char(..)

access:cstr(..)

字符截取:([]为可选)

sqlserver:substring(s,start,length)

oracle:substr(s,start[,length])

access:Mid(s,start[,length])

注:sqlserver和oracle中start可从0或1开始,二者结果是一样的,access只能从1开始

 5,case

在oracle,sqlserver都有case语句:

oracle:

数据库Oracle与SqlServer与Access数据库Oracle与SqlServer与AccessCode
select c.userid,
          a.unitcode,a.crid,a.isck,a.iszk,a.iszt,a.iszh,a.iswbz,
          (
case
          
when (select t.rylx from t_caijirecord t where t.crid=a.crid)=0 then 1
          
else 0
          
end) iscjk,
          (
case
          
when (select t.rylx from t_caijirecord t where t.crid=a.crid)=1 then 1
          
else 0
          
end) isczk,
          c.idcardnum,c.receivetime
     
from certrecord c inner join
          a_certrecord a 
on c.id = a.crid

 

数据库Oracle与SqlServer与Access数据库Oracle与SqlServer与AccessSqlServer
SELECT
UserPassportID 
as PassportID,
UserID,
GrantorID,
Case ObjectTypeID 
When 1 then ObjectID
End 
as TerminalID,
Type, Flag, GrantDate, Validate, Invalidate
From UserPassport

Access:

 

数据库Oracle与SqlServer与Access数据库Oracle与SqlServer与AccessAccess
select OperationNo,iif(IsMadeFile=1,'sended',iif(IsMadeFile=0,'nosend')) as IsSend from T_OperationHistory
select OperationNo,switch(IsMadeFile=1,'sended',IsMadeFile=0,'nosend'as IsSend from T_OperationHistory

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1255
24
MySQL vs. Other Databases: Comparing the Options MySQL vs. Other Databases: Comparing the Options Apr 15, 2025 am 12:08 AM

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

MySQL: Structured Data and Relational Databases MySQL: Structured Data and Relational Databases Apr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

Using Dicr/Yii2-Google to integrate Google API in YII2 Using Dicr/Yii2-Google to integrate Google API in YII2 Apr 18, 2025 am 11:54 AM

VprocesserazrabotkiveB-enclosed, Мнепришлостольностьсясзадачейтерациигооглапидляпапакробоглесхетсigootrive. LEAVALLYSUMBALLANCEFRIABLANCEFAUMDOPTOMATIFICATION, ČtookazaLovnetakProsto, Kakaožidal.Posenesko

MySQL: Key Features and Capabilities Explained MySQL: Key Features and Capabilities Explained Apr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

MySQL: A Beginner-Friendly Approach to Data Storage MySQL: A Beginner-Friendly Approach to Data Storage Apr 17, 2025 am 12:21 AM

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

Solve memory management problems in Magento project: application of zend-memory library Solve memory management problems in Magento project: application of zend-memory library Apr 17, 2025 pm 11:03 PM

I'm having a tough memory management problem while working on a Magento project. As the project involves a large amount of data processing, memory consumption increases rapidly, resulting in system performance degradation and even crashes. After some research, I discovered the zend-memory library, which effectively solved my memory management problem.

See all articles