sql - error occured : "Cannot call methods on nvarchar." -


i wrote query find answers related specific question, received error when runing code.

cannot call methods on nvarchar

 select posts.id answer, parentid question, user.displayname answerer    posts inner join users    on posts.owneruserid = users.id  parentid in (select posts.id  posts inner join posttags on posts.id          = posttags.postid inner join tags     on posttags.tagid    = tags.id inner join users    on posts.owneruserid = users.id inner join posttypes on posts.posttypeid = posttypes.id tags.tagname   in  (select     num.tagname tag    (select tagname tags, posttags, posts tags.id = posttags.tagid , posts.id = postid , posts.creationdate < '2015-04-20' , posts.creationdate > '2015-01-01' group tagname) rate  inner join (select tagname  tags, posttags, posts tags.id = posttags.tagid , posts.id = postid group tagname having count(postid) > 8000)as num  on rate.tagname = num.tagname )   , posts.answercount > 1   , posts.acceptedanswerid not null   , posts.score > 0   , posts.posttypeid  = 1                -- posttypeid = 1 -> question   , posts.communityowneddate null   ) , posts.posttypeid  = 2                -- -> answers 

i think problem parentid , not understand wrong.

you have reserved word user in query:

select posts.id answer, parentid question, user.displayname answerer

you need modify [user].displayname

here great resource on reserved words in sql: https://www.drupal.org/node/141051


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -