Question: I am working on a table which has data like this-- Sorry for formatting as I am new here

```
ColA  Type    Name    Email 
-----------------------   
1     Type1  John     yyyy@m  
1     Type2  Emily    xxx@m  
2     Type2  Richard  ooo@m  
3     Type1  Rebecca  pppp@m  
3     Type2  Pumpkin   nnnn@m  

```

I want to have an output based on Type Column 

```
COL1 TYPE1Name TYPE1Email Type2Name Type2Email 
-------------------------   
1    John      yyyy@m      Emily    xxx@m   
2    NULL      NULL        Richard  ooo@m  
3    Rebecca   pppp@m      Pumpkin    nnnn@m    

```

I tried 2 CTE's with the pivots and joining them but did not get the results 
Any suggestions

Answer: 
This is just an example to get you started in the right direction.

```
import java.util.Scanner;

public class Example {

    public static void main(String[] args) {
        Scanner user_input = new Scanner(System.in);
        int num1, num2, result;

        System.out.println("What Do You Want to Do? (a to add; s to"
                + " subrtact; d to divited; m to multiply, and s to square your nummber.)");

        String choice = user_input.next();

        // Add
        if (Character.isLetter('a')) {
            System.out.println("Enter first number: ");
            num1 = user_input.nextInt();
            System.out.println("Enter second number: ");
            num2 = user_input.nextInt();

            result = num1 + num2;
            System.out.println("Answer: " + result);
        }
    }
}

```
```
 Scanner s = new Scanner(System.in);
    String str = s.nextLine();
int a=s.nextInt();
int b=s.nextInt();
    if(str.equals("+"))
    c=a+b;
    else if(str.equals("-"))
    c=a-b;
    else if(str.equals("/"))
    c=a/b;
    // you can add operators as your use
    else
    System.out.println("Unidentified operator" );

```

I hope it helps!