How to Retrieving a Subset of Columns from a Table via SQL query

SQL studing: Subset of Columns via SQL

Problem

You have a table and want to see values for specific columns rather than for all the columns.

Solution

Specify the columns you are interested in. For example, to see only name, department number, and salary for employees:

1 select ename,deptno,sal
2   from emp

Discussion

By specifying the columns in the SELECT clause, you ensure that no extraneous data is returned. This can be especially important when retrieving data across a network, as it avoids the waste of time inherent in retrieving data that you do not need.

 

Вас заинтересует / Intresting for you:

A Brief History of SQL
A Brief History of SQL 2871 views Александров Попков Wed, 17 Oct 2018, 15:04:29
SQL: how to determine which ro...
SQL: how to determine which ro... 178 views Денис Tue, 06 Jul 2021, 18:47:53
Referencing an Aliased Column ...
Referencing an Aliased Column ... 253 views Денис Wed, 14 Jul 2021, 12:59:03
SQL: Locating the Beginning an...
SQL: Locating the Beginning an... 246 views Денис Sat, 10 Jul 2021, 18:02:52