Select Multiple in SQL
Selecting Multiple Columns in SQL
To select multiple columns from a table, you list the column names separated by commas in the SELECT statement.
Syntax
SELECT column1, column2, column3, ...FROM table_name;Example
Suppose you have a table employees with columns: id, name, department, salary.
To select the name, department, and salary columns:
SELECT name, department, salaryFROM employees;Notes
You can select as many columns as you want.
Use
SELECT *to select all columns from a table, but it's better to specify columns for performance and clarity.You can also combine columns with expressions or functions in the
SELECTclause.
Would you like an example of selecting multiple columns with some conditions or functions?