Summary of Oracle query statement Application Experience

Source: Internet
Author: User

The following articles mainly describe the practical application experience of Oracle query statements. If you are interested in the actual application of Oracle query statements, you can click the following articles to view them. I hope it will help you in this regard.

1. select * from table_name where rownum> begin and rownum <end

2. SQL = "select * from table"

 
 
  1. con.prepareCall("SELECT * FROM(SELECT A.*, rownum r FROM("+sql+") A WHERE rownum <=  
  2. "+intPage*intPageSize+") B WHERE r > "+(intPage-1)  
  3. *intPageSize);  

Today, I want to query all the table names under the OOracle database or all the tables under a user. I haven't thought about it for a long time. I still found the answer online.

 
 
  1. select table_name from all_tables; 

All

 
 
  1. select table_name from user_all_tables; 

All tables of a user in an Oracle query statement

The following is a post on the SQL statement.

Select * from user_objects; // query all tables

Select * from dba_tables; // query all tables

Select * from all_tables; // query all tables

Select * from user_users // find a user

Select * from all_users // query all users

Select * from dba_users // query all users

Select name, dbid from v $ database; // query the database name and its ID

Select * from sys. user_tab_columns; // query the table name and display the column name.

Describe table name // query the table structure

Select * from sys. user_tab_columns where table_name = table name

Queries the fields of a specified table name.

2: query database Parameters

 
 
  1. show parameter db; 

3: The instance name of the database queried by the Oracle query statement.

 
 
  1. select instance_name from v$instance; 

4: Database Domain Name

After the database is installed, you can use

 
 
  1. select value from v$parameter where name='db_domain' 
  2. show parameter domain  

5: Database Service name

If the database has a domain name, the Database Service name is the global database name. If no domain name is defined for the database, the Database Service name is the same as the database name.

 
 
  1. show parameter service_name 

6: display the current user

 
 
  1. show user 

7: Direct Login

 
 
  1. sqlplus "/as sysdba" 

8: Current OOracle system time

 
 
  1. select sysdate from dual; 

9: query the database dictionary v $ nls_parameter to view character set parameters

 
 
  1. select * from v$nls_parameters;  

The above content is an introduction to the Oracle query statement book. I hope you will have some gains.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.