this is my furniture_ch table that save users information
1-furniture_ch
Id
|
Name
|
Address
|
Tell
|
Behcode
|
F_code
|
1
|
Paris
|
Paris
|
123456
|
1111
|
1
|
2
|
Milan
|
Milan
|
123456
|
2222
|
2
|
3
|
Italy
|
Italy
|
123456
|
3333
|
3
|
and this is my furniture_p table.when users insert their product,products information save in this table
2-furniture_p
Id
|
Name
|
Image
|
Description
|
Behcode
|
date
|
1
|
Name1
|
Image1
|
Description1
|
1111
|
3/9/2012 6:20:41 PM
|
2
|
Name2
|
Image2
|
Description2
|
2222
|
4/9/2012 6:29:28 PM
|
3
|
Name3
|
Image3
|
Description3
|
1111
|
2/9/2012 6:29:49 PM
|
4
|
Name4
|
Image4
|
Description4
|
1111
|
3/9/2012 6:30:19 PM
|
5
|
Name5
|
Image5
|
Description5
|
3333
|
1/9/2012 6:30:45 PM
|
now i want in my page shows users information that insert their product recently sort by date
at first i run this query in sql
SELECT address ,tell,name
,(Select COUNT(behcode) from furniture_p where behcode= furniture_ch.behcode) as [count]
from furniture_ch order by furniture_p.date desc
this error occur:
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "furniture_p.date" could not be bound.
after that i wrote your store proc in sql when run occured this error:
Msg 209, Level 16, State 1, Procedure GetProducts, Line 5
Ambiguous column name 'id'.
Msg 209, Level 16, State 1, Procedure GetProducts, Line 5
Ambiguous column name 'name'.
Msg 209, Level 16, State 1, Procedure GetProducts, Line 5
Ambiguous column name 'behcode'.
now what can i do?