Subject | SELECT STATMENT |
---|---|
Author | Ben Johnson |
Post date | 2002-01-30T16:21:56Z |
Hi,
can somebody show me how to write a select statment to display
how many times an item is billed from the following data.
Bill No. Item Code Batch Code
------------------------------------------
1 2 3
1 2 1
1 3 4
1 1 2
2 3 4
2 4 5
3 3 4
3 2 1
3 1 2
3 3 6
The select statment should return
Item Code Billed
----------------------
1 2
2 2
3 3
4 1
Billed column should show under how many bills that particular Item code is appearing, need to consider only an item once if it is appearing once or more than once in a bill.
Thank you.
Ben
can somebody show me how to write a select statment to display
how many times an item is billed from the following data.
Bill No. Item Code Batch Code
------------------------------------------
1 2 3
1 2 1
1 3 4
1 1 2
2 3 4
2 4 5
3 3 4
3 2 1
3 1 2
3 3 6
The select statment should return
Item Code Billed
----------------------
1 2
2 2
3 3
4 1
Billed column should show under how many bills that particular Item code is appearing, need to consider only an item once if it is appearing once or more than once in a bill.
Thank you.
Ben