spiff2002
IS-IT--Management
- Jan 31, 2003
- 40
I'm trying to select a gruop of items within a group
Suppose I have two tables.
A brand table (brandtable)
id Decsription
-- -----------
1 brandA
2 brandB
3 brandC
an Item table (itemtable)
id Description Brandid
-- ----------- -------
1 item1 1
2 item2 1
3 item3 2
4 item4 3
5 item5 3
6 item6 3
7 item7 3
8 item8 3
I need to run a select * from itemtable
but only select some items from brand3
like (if brandid = 3 then select itemtable.id>=4 and itemtable.id<=6)
and the result would be something like
id Description Brandid
-- ----------- -------
1 item1 1
2 item2 1
3 item3 2
4 item4 3
5 item5 3
6 item6 3
Suppose I have two tables.
A brand table (brandtable)
id Decsription
-- -----------
1 brandA
2 brandB
3 brandC
an Item table (itemtable)
id Description Brandid
-- ----------- -------
1 item1 1
2 item2 1
3 item3 2
4 item4 3
5 item5 3
6 item6 3
7 item7 3
8 item8 3
I need to run a select * from itemtable
but only select some items from brand3
like (if brandid = 3 then select itemtable.id>=4 and itemtable.id<=6)
and the result would be something like
id Description Brandid
-- ----------- -------
1 item1 1
2 item2 1
3 item3 2
4 item4 3
5 item5 3
6 item6 3