CREATE TABLE tblSorular
(
soru_ID INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
soru VARCHAR(100),
durum TINYINT DEFAULT 0
)



CREATE TABLE tblCevaplar
(
cevap_ID INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
soru_ID INT DEFAULT 0,
oy INT DEFAULT 0,
sira INT DEFAULT 0
)



select s.soru_ID, s.soru, MAX(c.oy) from
tblsorular as s INNER JOIN tblcevaplar as c
ON
s.soru_ID = c.soru_ID