Seeking a sql statement

Category: MS-SQL Server -> Applications Author: cicivs Date: 2001-07-09 03:28:57
 
cicivs
2001-07-09 03:28:57
Involves three tables:
Member (membership form)
main structure:
id identification Primary key
Membername vachar with club name
..... slightly

------------ ----------------------------------------------
Pro Table (merchandise table)

main structure:

id identifies the primary key
ProName varchar goods Name
Userid bigint release this product that the user id of the Member id
..... slightly

------------------------------ ---------------------------

shoplist Orders table

- -------------------------------------------------- -----
main structure:
id identifies the primary key
ProIDList varchar orders Product id list with " ;, "separated for example:" 2,3,4,5 "
..... slightly

---------- -----------------------------------------------

Objective:
such

in order check out the table contains Userid = 1 for all users to publish product orders
fengamie
2001-07-09 03:48:03
This
select L. * from shoplist L join Pro R
on charindex (',' + convert (nvarchar, R.id) + ',' , ',' + L.ProIDList + ',')> 0
where R.Userid = 1
guzongfang
2001-07-09 04:21:42
select L. * from shoplist L join Pro ; R
on charindex (',' + R.id + ',', ',' + L.ProIDList + ',')> 0
where R.Userid = 1

cfk1979
2001-07-09 04:58:13
Frank upstairs trials. . .
huyuyu
2001-07-09 05:31:39
select L. * from shoplist L join Pro R on charindex (',' + str (R.id) + ',', ',' + L . ProIDList + ',')> 0 where R.Userid = 4

pisces007 butterfly fish): Your sql statement less str I add, do not known to affect the effect?

but I did not inquire into the above statement recorded shoplist database table does have userid = 4 released product orders