K
kaeli
I know this is completely OT, but I don't know where to ask and most of
you here seem to know some SQL.
If anyone knows a good group for this question, point me to it please.
I can't figure out a nice way to get some data I want. I have a
convoluted way with virtual tables, but there has to be something easier
than what I am currently doing, so here goes.
I have a table. For example's sake, I'm showing this with a test table,
not my real table.
Anyway, lets call it tblCar. Among the columns are color, make, model,
and year.
So, we can have rows like
blue, chevy, impala, 1990
red, chevy, impala, 1991
blue, ford, explorer, 2000
green, kia, rio, 2001
and so on.
What I need is a good SQL query to get the following type of result.
| blue | green
-------------------------
chevy 5 15
ford 10 20
kia 3 6
A total of colors, by make.
Any ideas?
--
--
~kaeli~
A midget fortune teller who escapes from prison is a small
medium at large.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
you here seem to know some SQL.
If anyone knows a good group for this question, point me to it please.
I can't figure out a nice way to get some data I want. I have a
convoluted way with virtual tables, but there has to be something easier
than what I am currently doing, so here goes.
I have a table. For example's sake, I'm showing this with a test table,
not my real table.
Anyway, lets call it tblCar. Among the columns are color, make, model,
and year.
So, we can have rows like
blue, chevy, impala, 1990
red, chevy, impala, 1991
blue, ford, explorer, 2000
green, kia, rio, 2001
and so on.
What I need is a good SQL query to get the following type of result.
| blue | green
-------------------------
chevy 5 15
ford 10 20
kia 3 6
A total of colors, by make.
Any ideas?
--
--
~kaeli~
A midget fortune teller who escapes from prison is a small
medium at large.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace