AnonGod
IS-IT--Management
- Jun 5, 2000
- 223
Hey there -
Trying to query some data and having a hard time getting my head around what needs to be done. I'm fairly sure I need a nested query, but just can't see where to put it...
Existing data sample:
[tt]
col1 col2 col3
Cat Hat Book
Big Hit Movie
Cool Beans Phrase
Cat Hat Book
Big Hit Movie
Cat Hat Book
Big Hit Movie
Cool Beans Phrase
Cat Hat Book
[/tt]
Here's the format I want the data returned in:
[tt]
col1 col2 col3 col4
Cat Hat Book 4
Big Hit Movie 3
Cool Beans Phrase 2
[/tt]
Col4 is a count column of the # of entries.
I keep thinking this is something simple, but the queries i've tried keep returning syntax errors. I'm just not getting it.
I need this in pure SQL syntax.
Any help is appreciated.
Thanks!
-Andrew
[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'
Trying to query some data and having a hard time getting my head around what needs to be done. I'm fairly sure I need a nested query, but just can't see where to put it...
Existing data sample:
[tt]
col1 col2 col3
Cat Hat Book
Big Hit Movie
Cool Beans Phrase
Cat Hat Book
Big Hit Movie
Cat Hat Book
Big Hit Movie
Cool Beans Phrase
Cat Hat Book
[/tt]
Here's the format I want the data returned in:
[tt]
col1 col2 col3 col4
Cat Hat Book 4
Big Hit Movie 3
Cool Beans Phrase 2
[/tt]
Col4 is a count column of the # of entries.
I keep thinking this is something simple, but the queries i've tried keep returning syntax errors. I'm just not getting it.
I need this in pure SQL syntax.
Any help is appreciated.
Thanks!

[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'