Hi,
I have these two tables:
Table stringwid
Field: wid nvarchar(10)
content: 01010101
02010101
Table stringrule
Field: rid integer, rulewid nvarchar(10)
content: 1 01010101
1 02
2 0101
2 0201
3 01
I've made the following SQL:
select stringwid.wid as purewid, rulewid, stringrule.rid
from stringwid, stringrule
where stringwid.wid like rulewid+'%' order by rid
And the results follow:
purewid rulewid rid
01010101 01010101 1
02010101 02 1
02010101 0201 2
01010101 0101 2
01010101 01 3
Actually, I want the result only have the rids with 1 and 2
because the corresponding rulewids are both similar to purewid. i.e. I want to retrieve the count of rid = the number of row of stringwid table..
How to do this?
I have these two tables:
Table stringwid
Field: wid nvarchar(10)
content: 01010101
02010101
Table stringrule
Field: rid integer, rulewid nvarchar(10)
content: 1 01010101
1 02
2 0101
2 0201
3 01
I've made the following SQL:
select stringwid.wid as purewid, rulewid, stringrule.rid
from stringwid, stringrule
where stringwid.wid like rulewid+'%' order by rid
And the results follow:
purewid rulewid rid
01010101 01010101 1
02010101 02 1
02010101 0201 2
01010101 0101 2
01010101 01 3
Actually, I want the result only have the rids with 1 and 2
because the corresponding rulewids are both similar to purewid. i.e. I want to retrieve the count of rid = the number of row of stringwid table..
How to do this?