Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to add a select count to working sql statement

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
I am trying to add a select count inside this sql statement, but i get this error: any ideas?

Code:
Microsoft OLE DB Provider for ODBC Drivers error '80040e31'

Operand should contain 1 column(s)


Code:
SELECT 
post.pid,
post.ptid,
post.ptid2,
post.puid,
post.psubject,
post.ptype,
post.preplycount,
post.ptime,
post.psticky,
post.ptimereply, (SELECT count(cpost.pid), cpost.preplyid FROM forumpost as cpost WHERE cpost.preplyid=post.pid group by cpost.preplyid) as replycount,
user.uid,
user.uname,
thread.tid,
thread.tname
 FROM forumpost as post, users as user, thread WHERE user.uid=post.puid AND post.ptype=0 AND ptid=1  AND ptid2=2  AND thread.tid=2  Order by post.psticky DESC,post.pid DESC Limit 10




Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
i figured it out ;)

Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top