mysql如何用一个表里的两个字段决定另一个表俩面的一个字段?

例如 表 poster中有uid和cityid两个字段,表news中含有uid字段,如何筛选cityid=x的表news下的信息呢?

select a.uid,cityid,b.* from poster a,news b where a.uid=b.uid and cityid=x追问

这样好像不行,显示语句错误。

追答

报的什么错? news表除了uid,还有什么字段

追问

还有好多字段,就是企业新闻,像posttime,title,content,等等。
Mysql语句有误,错误报告如下:
数据库连接出错:……
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
1064

追答

这好象不是语句的错误,是数据库连接错误呀

温馨提示:答案为网友推荐,仅供参考