Loading topic
SELECT statement reads data and returns it as a result set, which has the same shape as a table: named columns and zero or more rows. This chapter covers the parts of a query, the rules for writing them, and the errors you will see most often. Later chapters cover each part in detail.6 min readSELECT ... FROM table in SQL*Plus, SQL Developer, or SQL Worksheet. It also assumes you know what rows, columns, and the basic data types are. The 6 min readSELECT and FROM. You will choose columns, rename them with aliases, and learn where an alias can and cannot be used. It assumes you can run a query in SQL*Plus, SQL Developer or SQL Worksheet. It also assumes you know what a table,6 min readdual, so they run without a6 min readSELECT ... FROM statement, know what the DUAL table is, and can give columns aliases. It also assumes you have an Oracle session in SQL*Plus, SQL Developer, or SQL Worksheet. The HR sample schema is used for table examples.5 min readSELECT ... FROM dual: reading the current date and time, drawing values from a sequence, and testing expressions without touching an application table. It assumes you can already write a basic SELECT, know that DUAL is a one-row, one-column table, and6 min readSELECT ... FROM statement, you have a session open in SQL*Plus, SQL Developer or SQL Worksheet, and you know the basic data types (numbers, strings, dates). The examples use the HR sample schema, mainly the employees table.6 min readSELECT ... FROM ... WHERE query in an Oracle session and know what rows, columns, and the common data types are. It covers what NULL means, how it behaves in comparisons and expressions, and how to handle it in the output. The examples use the HR sample s6 min readSELECT ... FROM ... WHERE query and can run it in SQL*Plus, SQL Developer, or SQL Worksheet. It also assumes you know what NULL means. The examples use the HR sample schema, with a few DUAL-based queries where a real table would add noise.6 min readSELECT ... FROM ... WHERE query and sort with ORDER BY. It covers what DISTINCT compares, how it treats NULL, how it interacts with sorting and row limiting, and when it is the wrong tool.6 min readSELECT with WHERE and ORDER BY, and that you have the HR sample schema available. The row limiting clause is how you ask Oracle for only the first few rows of a result. You use it for top-N reports, paging through results, and previews of large tables.6 min readSELECT ... FROM ... WHERE ... ORDER BY statement and know what a column alias is. It also assumes you have run queries against the HR sample schema. Here you learn the order in which Oracle logically evaluates the clauses of a query. That order explains m6 min read