Reputation: 13
I have the following table:
empid,paygrp,paycode,amount
1 A 1 200
1 A 2 300
1 A 3 500
1 B 4 600
1 B 5 700
is it possible to use sql statement to produce the following result?
1 A 1 200 B 4 600
1 A 2 300 B 5 700
1 A 3 500
Upvotes: 1
Views: 92
Reputation: 79794
You need to do two queries for this:
SELECT *
FROM table
WHERE paygrp='A';
SELECT *
FROM table
WHERE paygrp='B';
Upvotes: 1