SQL SELECT

SQL SELECT Function


If you want to select particular columns of your dataset and view this selection on your MY DATA homepage use a SELECT query. When you open a dataset from your MY DATA page and open the SQL box on the right side, you will see the following code:

SELECT * FROM {name of dataset}

As you can see this is a SELECT query where all columns of a dataset are shown. The setup of this query looks like this:

  • The SELECT keyword is used to select data from the database;
  • The asterisk (*) is used to select all columns;
  • The FROM keyword indicates that the data is selected from a particular dataset;
  • After the FROM statement the name of the dataset that contains the data you are looking for is specified.

In the example below you can see a SELECT statement that selects all columns of the dataset usa_salesmanagers_2_digit_areas.

SELECT * FROM usa_salesmanagers_2_digit_areas

SELECT Query

If you want to select only certain columns of a dataset you have to replace the asterisk (*) with the name of the columns. If you want to select more than one column use a comma to separate the columns. In the example below we want to show only the pc2 and salesmanager column of the usa_salesmanager_2_digit_areas dataset.

SELECT pc2, salesmanager FROM usa_salesmanagers_2_digit_areas

SELECT Query