Skip to main content
The 2024 Developer Survey results are live! See the results

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.

1354 votes
16 answers
2.5m views

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 ...
Mathieu Longtin's user avatar
1216 votes
26 answers
2.4m views

Get list of all tables in Oracle?

How do I query an Oracle database to display the names of all tables in it?
vitule's user avatar
  • 15.8k
678 votes
36 answers
697k views

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....
Umang's user avatar
  • 6,815
527 votes
18 answers
1.4m views

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's user avatar
495 votes
34 answers
1.1m views

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 ...
Charles Roper's user avatar
463 votes
11 answers
652k views

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 ...
Amit's user avatar
  • 21.9k
458 votes
29 answers
818k views

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 ...
selfawaresoup's user avatar
448 votes
9 answers
718k views

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's user avatar
  • 4,581
440 votes
8 answers
785k views

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

What is the difference between Views and Materialized Views in Oracle?
juan's user avatar
  • 81.4k
419 votes
16 answers
681k views

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 ...
Alana Storm's user avatar
415 votes
13 answers
393k views

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 ...
Peter's user avatar
  • 5,794
389 votes
9 answers
869k views

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, ...
jamz's user avatar
  • 5,221
380 votes
16 answers
1.1m views

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 ...
user169743's user avatar
  • 4,217
360 votes
16 answers
296k views

Difference between a user and a schema in Oracle?

What is the difference between a user and a schema in Oracle?
sengs's user avatar
  • 6,717
342 votes
11 answers
562k views

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's user avatar
  • 3,421

15 30 50 per page
1
2 3 4 5
10147