> For the complete documentation index, see [llms.txt](https://gchandra.gitbook.io/data-warehousing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gchandra.gitbook.io/data-warehousing/rdbms/sql-concepts/wild-cards-and-distinct.md).

# Wild Cards & Distinct

### Wild Cards

Used to replace one or more characters

% wild card to replace more than one character

\_ wild card to replace one character.

```sql
-- Starting with character 'A'

select FirstName from Chinook.Customer where FirstName like 'A%';
```

### Distinct

Distinct is used to get a unique set of records from a table.

```sql
-- select distinct column1 from table;

-- Table Alias
select FirstName from Chinook.Customer c order by FirstName;

-- Table Alias
select distinct FirstName from Chinook.Customer c;
```

### Distinct and NULL

MySQL keeps one NULL value and eliminates the other because the DISTINCT clause treats all

NULL values as the same value.

### Distinct with Multiple Columns

```sql
select FirstName,LastName from Chinook.Customer;
```
