SQL Server SELECT Query
SELECT statement is used to fetch the data from database table.
-- example
SELECT column1, column2, columnN FROM table_name;
Below is the Person Table with Data
ID | Name | Age | Address | Salary |
---|---|---|---|---|
1 | Keerthana | 24 | Hyderabad | 10,000 |
2 | Madhav | 22 | Mumbai | 8500 |
Following is an example, which fetches data rows based on the column names from the Person table:
SELECT ID, NAME, SALARY FROM Person;
This would produce the following result
ID | Name | Salary |
---|---|---|
1 | Keerthana | 10,000 |
2 | Madhav | 8500 |
Following is an example, to fetch all data rows with asterisk (*) wildcard character from Person Table.
SELECT * FROM Person
This would produce the following result
ID | Name | Age | Address | Salary |
---|---|---|---|---|
1 | Keerthana | 24 | Hyderabad | 10,000 |
2 | Madhav | 22 | Mumbai | 8500 |
SQL Server Connection String Formats
posted on 2019-08-27 05:53:53 - SQL Server Tutorials