SQL Server에서 데이터 조작을 위한 함수
Ana Voicu
Data Engineer
유의: 두 값을 비교하려면 같은 형식이어야 합니다.
그렇지 않으면:
SELECT
company
bean_type,
cocoa_percent
FROM ratings;
SELECT
company
bean_type,
cocoa_percent
FROM ratings
WHERE cocoa_percent > 0.5;
| company | bean_type | cocoa_percent |
|---------|------------|---------------|
| Amedei | Blend | 0.7000 |
| Bonnat | Trinitario | 0.7500 |
| ... | ... | ... |
SELECT
company
bean_type,
cocoa_percent
FROM ratings
WHERE cocoa_percent > -2;
| company | bean_type | cocoa_percent |
|---------|------------|---------------|
| Amedei | Blend | 0.7000 |
| Bonnat | Trinitario | 0.7500 |
| ... | ... | ... |
SELECT
company
bean_type,
cocoa_percent
FROM ratings
WHERE cocoa_percent > GETDATE();
| company | bean_type | cocoa_percent |
|---------|------------|---------------|
| ... | ... | ... |
SELECT
company
bean_type,
cocoa_percent
FROM ratings
WHERE cocoa_percent > 'A';
| result |
|------------------------------------------------|
| Error converting data type varchar to numeric. |
SELECT
company
bean_type,
cocoa_percent
FROM ratings
WHERE cocoa_percent > '0.5';
| company | bean_type | cocoa_percent |
|---------|------------|---------------|
| Amedei | Blend | 0.7000 |
| Bonnat | Trinitario | 0.7500 |
| ... | ... | ... |
SQL Server에서 데이터 조작을 위한 함수