天天看點

mysql 兩條相同的記錄_mysql用主鍵查詢出兩條相同的記錄

SELECT a.id,

a.user_id AS userId,

a.content, a.status,

a.create_time AS createTime,

a.address,

a.type,

a.people_count AS peopleCount,

a.fee_content AS feeContent,

a.active_time AS activeTime,

a.condition, a.pic,

a.join_count,

c.avatars AS initiatorAvatars,

c.phone AS initiatorPhone,

c.name As initiatorName

FROM t_active a

LEFT JOIN t_join_active b ON a.id = b.active_id

LEFT JOIN t_user c ON a.user_id=c.id

WHERE a.id=?

id是主鍵查詢出兩條相同的記錄。

org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2

報了這個錯。

sql複制到資料庫中查詢,隻有一條。請教是什麼問題

mysql 兩條相同的記錄_mysql用主鍵查詢出兩條相同的記錄