I have data that looks like
| ID | FRUIT |
|---|---|
| 1 | Pear |
| 1 | Orange |
| 2 | Apple |
| 2 | Pear |
And I want to get to
| ID | Pear | Orange | Apple |
|---|---|---|---|
| 1 | Y | Y | N |
| 2 | Y | N | Y |
I looked at https://forum.vertica.com/discussion/238733/how-do-i-pivot-in-vertica but still stuck. Can anyone help?
I have data that looks like
| ID | FRUIT |
|---|---|
| 1 | Pear |
| 1 | Orange |
| 2 | Apple |
| 2 | Pear |
And I want to get to
| ID | Pear | Orange | Apple |
|---|---|---|---|
| 1 | Y | Y | N |
| 2 | Y | N | Y |
I looked at https://forum.vertica.com/discussion/238733/how-do-i-pivot-in-vertica but still stuck. Can anyone help?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.