Good evening.
I've been tinkering with SQL Pass Throughs to make my ODBC reports run faster but I can't figure something out.
There are several fields from the records I'm retrieving that share a key. What I'm trying to do is keep these records on 1 line of the output but can't seem to get it.
Here is a sample of the SQL I have.
SELECT (CASE WHEN AF.A = 'G' THEN 'Y' END) AS G, (CASE WHEN AF.A = 'N' THEN 'Y' END) AS N, (CASE WHEN AF.A = 'M' THEN 'Y' END) AS M, AF.QUAL
FROM XYZ.ADD_FAC AS AF
What I want to have returned is something like:
G N M QUAL
Y Y 123456
Y Y 5678901
Instead I get:
G N M QUAL
Y 123456
Y 123456
Y 5678901
Y 5678901
Any help or direction would be greatly appreciated. Again, I've just gotten myself into SQL pass throughs recently and trying to teach myself/learn as I go.
Thanks!
I've been tinkering with SQL Pass Throughs to make my ODBC reports run faster but I can't figure something out.
There are several fields from the records I'm retrieving that share a key. What I'm trying to do is keep these records on 1 line of the output but can't seem to get it.
Here is a sample of the SQL I have.
SELECT (CASE WHEN AF.A = 'G' THEN 'Y' END) AS G, (CASE WHEN AF.A = 'N' THEN 'Y' END) AS N, (CASE WHEN AF.A = 'M' THEN 'Y' END) AS M, AF.QUAL
FROM XYZ.ADD_FAC AS AF
What I want to have returned is something like:
G N M QUAL
Y Y 123456
Y Y 5678901
Instead I get:
G N M QUAL
Y 123456
Y 123456
Y 5678901
Y 5678901
Any help or direction would be greatly appreciated. Again, I've just gotten myself into SQL pass throughs recently and trying to teach myself/learn as I go.
Thanks!