Click here to Skip to main content
15,888,984 members
Home / Discussions / Database
   

Database

 
GeneralRe: Running SQL server 2000 & 2005 side by side Pin
Tiger4569-Jan-06 1:46
Tiger4569-Jan-06 1:46 
GeneralRe: Running SQL server 2000 & 2005 side by side Pin
Colin Angus Mackay9-Jan-06 20:57
Colin Angus Mackay9-Jan-06 20:57 
GeneralRe: Running SQL server 2000 & 2005 side by side Pin
Tiger45610-Jan-06 17:24
Tiger45610-Jan-06 17:24 
GeneralRe: Running SQL server 2000 & 2005 side by side Pin
Colin Angus Mackay10-Jan-06 20:41
Colin Angus Mackay10-Jan-06 20:41 
GeneralRe: Running SQL server 2000 & 2005 side by side Pin
dl4gbe12-Jan-06 2:48
dl4gbe12-Jan-06 2:48 
QuestionRemote SQL Database Pin
HakunaMatada9-Jan-06 0:26
HakunaMatada9-Jan-06 0:26 
AnswerRe: Remote SQL Database Pin
Colin Angus Mackay9-Jan-06 1:14
Colin Angus Mackay9-Jan-06 1:14 
Questionsql: count product's item, how about the zero item? Pin
zrocb818-Jan-06 12:27
zrocb818-Jan-06 12:27 
Hi, everyone. Need help here. Let's straight to question:

I have 2 tables:
tb1 -- productID, productDescription
tb2 -- productID, itemID, itemDescription......blabla

In my tb1:
productID | productDescription
-------------------------------
HAD | Hardware
TOY | Toy
CAR | Car
STA | Stationary

and in my tb 2:
productID | itemID | itemDescription ......blabla
-------------------------------------------------
HAD | mou1 | mouse1
HAD | mou2 | mouse2
HAD | mou3 | mouse3
...
..
TOY | scar1 | small car1
TOY | scar2 | small car2
...
..
.

Assume that
there got 7 items under TOY, 18 under HAD, 18 under CAR,
and ___No Item Under STA___ <--- I have problem with this. keep reading.
--------------------------------------------------------------

i'm using MSSQL,
this is the sql command i worked so far:

select tb1.productID, count (tb2.itemID) as CountedProducts
from tb1, tb2 where
tb1.productID=tb2.productID
group by tb1.productID

/*result*/
TOY 7
HAD 18
CAR 18
/********************/

but the expected result i want is suppose to be like this
STA 0
TOY 7
HAD 18
CAR 18


anyone please help. thx.
AnswerRe: sql: count product's item, how about the zero item? Pin
nguyenvhn8-Jan-06 17:08
nguyenvhn8-Jan-06 17:08 
GeneralRe: sql: count product's item, how about the zero item? Pin
zrocb818-Jan-06 17:34
zrocb818-Jan-06 17:34 
QuestionHow can i shutdown database in oracle 10g Pin
Ta_Tee4737-Jan-06 17:26
Ta_Tee4737-Jan-06 17:26 
AnswerRe: How can i shutdown database in oracle 10g Pin
Dave Kreskowiak8-Jan-06 16:14
mveDave Kreskowiak8-Jan-06 16:14 
QuestionExport 50,000 records to a Text File. Pin
kakarato6-Jan-06 7:52
kakarato6-Jan-06 7:52 
AnswerRe: Export 50,000 records to a Text File. Pin
Colin Angus Mackay6-Jan-06 12:00
Colin Angus Mackay6-Jan-06 12:00 
GeneralRe: Export 50,000 records to a Text File. Pin
kakarato7-Jan-06 6:22
kakarato7-Jan-06 6:22 
Questionincreasing size of LDF file Pin
Member 20731416-Jan-06 2:52
Member 20731416-Jan-06 2:52 
AnswerRe: increasing size of LDF file Pin
Dave Kreskowiak6-Jan-06 5:17
mveDave Kreskowiak6-Jan-06 5:17 
AnswerRe: increasing size of LDF file Pin
Dave Kreskowiak6-Jan-06 7:05
mveDave Kreskowiak6-Jan-06 7:05 
GeneralRe: increasing size of LDF file Pin
Member 20731416-Jan-06 17:47
Member 20731416-Jan-06 17:47 
GeneralRe: increasing size of LDF file Pin
Dave Kreskowiak7-Jan-06 6:30
mveDave Kreskowiak7-Jan-06 6:30 
QuestionSQL Sample Databases Pin
Brendan Vogt6-Jan-06 0:34
Brendan Vogt6-Jan-06 0:34 
AnswerRe: SQL Sample Databases Pin
Colin Angus Mackay6-Jan-06 1:24
Colin Angus Mackay6-Jan-06 1:24 
QuestionRe: SQL Sample Databases Pin
Brendan Vogt6-Jan-06 1:29
Brendan Vogt6-Jan-06 1:29 
AnswerRe: SQL Sample Databases Pin
gharry6-Jan-06 5:44
gharry6-Jan-06 5:44 
QuestionSQL Doubt. Pin
<color>Aljechin 5-Jan-06 19:32
<color>Aljechin 5-Jan-06 19:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.