Questions tagged [oracle]

Oracle Database is a Multi-Model Database Management System created by Oracle Corporation. Do NOT use this tag for other products owned by Oracle, such as Java and MySQL.

Oracle is a Multi-Model Database Management System created by Oracle Corporation.

Note: This tag is not for questions about other products owned by Oracle Corporation, such as Java and MySQL.

It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java.

Free version of Oracle database

Oracle provides a free version of their on-premises database called Oracle Database Express Edition (Oracle XE), and a free version of their cloud service database called Always Free Autonomous Database.

When posting questions with the tag, please be sure to always include Oracle edition and version.

How to tag questions

  • about SQL in general should probably be tagged .
  • about PL/SQL in particular should probably be tagged as well as .
  • specific to a particular database version may be tagged ,,,,, or , as appropriate, but they should also be tagged at least.
  • about the free version of Oracle, Oracle XE, may be tagged or , but should be tagged at least.
  • about Oracle HTMLDB or Application Express (any version) may be tagged , but should be tagged at least.
  • about Oracle Objects for OLE should be tagged to avoid confusion with standard provider methods of accessing Oracle data.
  • about other Oracle Corp. database products should not be tagged , rather use the more specific tag to the technology, e.g. .
  • about Oracle Exadata Appliance (any version) may be tagged , but should be tagged at least.

Useful links

Book recommendations

149755 questions
1310
votes
15 answers

How do I limit the number of rows returned by an Oracle query after ordering?

Is there a way to make an Oracle query behave like it contains a MySQL limit clause? In MySQL, I can do this: select * from sometable order by name limit 20,10 to get the 21st to the 30th rows (skip the first 20, give the next 10). The rows are…
Mathieu Longtin
  • 15,922
  • 6
  • 30
  • 40
1201
votes
25 answers

Get list of all tables in Oracle?

How do I query an Oracle database to display the names of all tables in it?
vitule
  • 15,612
  • 11
  • 33
  • 37
664
votes
35 answers

Fetch the rows which have the Max value for a column for each distinct value of another column

Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. How do I do this in SQL? (Preferably Oracle.) I need to get ALL the UserIds. But for each…
Umang
  • 6,675
  • 3
  • 18
  • 6
515
votes
18 answers

How to create id with AUTO_INCREMENT on Oracle?

It appears that there is no concept of AUTO_INCREMENT in Oracle, up until and including version 11g. How can I create a column that behaves like auto increment in Oracle 11g?
Sushan Ghimire
  • 7,307
  • 16
  • 38
  • 65
487
votes
34 answers

How to select the nth row in a SQL database table?

I'm interested in learning some (ideally) database agnostic ways of selecting the nth row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases: SQL…
Charles Roper
  • 20,125
  • 20
  • 71
  • 101
452
votes
11 answers

Can a foreign key be NULL and/or duplicate?

Please clarify two things for me: Can a Foreign key be NULL? Can a Foreign key be duplicate? As fair as I know, NULL shouldn't be used in foreign keys, but in some application of mine I'm able to input NULL in both Oracle and SQL Server, and I…
Amit
  • 21,570
  • 27
  • 74
  • 94
444
votes
28 answers

Is there a combination of "LIKE" and "IN" in SQL?

In SQL I (sadly) often have to use "LIKE" conditions due to databases that violate nearly every rule of normalization. I can't change that right now. But that's irrelevant to the question. Further, I often use conditions like WHERE something in…
selfawaresoup
  • 15,473
  • 7
  • 36
  • 47
440
votes
9 answers

How to generate an entity-relationship (ER) diagram using Oracle SQL Developer

I want to use Oracle SQL Developer to generate an ER diagram for my DB tables but I am new to Oracle and this tool. What is the process for creating an ER diagram in SQL Developer?
Breezescut
  • 4,501
  • 3
  • 15
  • 4
424
votes
8 answers

What is the difference between Views and Materialized Views in Oracle?

What is the difference between Views and Materialized Views in Oracle?
juan
  • 80,295
  • 52
  • 162
  • 195
410
votes
16 answers

Oracle: If Table Exists

I'm writing some migration scripts for an Oracle database, and was hoping Oracle had something similar to MySQL's IF EXISTS construct. Specifically, whenever I want to drop a table in MySQL, I do something like DROP TABLE IF EXISTS…
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
394
votes
12 answers

Liquibase lock - reasons?

I get this when running a lot of liquibase-scripts against a Oracle-server. SomeComputer is me. Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog…
Peter
  • 5,556
  • 3
  • 23
  • 38
369
votes
9 answers

Best way to do multi-row insert in Oracle?

I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle. INSERT INTO TMP_DIM_EXCH_RT (EXCH_WH_KEY, EXCH_NAT_KEY, EXCH_DATE, EXCH_RATE, …
jamz
  • 4,991
  • 4
  • 24
  • 19
365
votes
15 answers

Update statement with inner join on Oracle

I have a query which works fine in MySQL, but when I run it on Oracle I get the following error: SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended" The query is: UPDATE table1 INNER JOIN table2…
user169743
  • 4,067
  • 5
  • 19
  • 14
358
votes
15 answers

Difference between a user and a schema in Oracle?

What is the difference between a user and a schema in Oracle?
sengs
  • 6,647
  • 6
  • 30
  • 24
334
votes
11 answers

Is there any boolean type in Oracle databases?

Is there any Boolean type in Oracle databases, similar to the BIT datatype in Ms SQL Server?
Peder
  • 3,341
  • 2
  • 15
  • 3
1
2 3
99 100