日期:2014-05-17 浏览次数:20539 次
select Message_index.message_id,Message_index.username,Message_index.date,text_table.Text
from Message_index,text_table
where Message_index.message_id=text_table.message_id
select Message_index.message_id,Message_index.username,Message_index.date,image_table.Message_Text
from Message_index,image_table
where Message_index.message_id=image_table.Message_id
--转换成一条语句
select Message_index.message_id,Message_index.username,Message_index.date,text_table.Text,image_table.Message_Text
from Message_index,text_table,image_table
where Message_index.message_id=text_table.message_id AND Message_index.message_id=image_table.Message_id
--或者
select Message_index.message_id,Message_index.username,Message_index.date,text_table.Text,image_table.Message_Text
from Message_index
INNER JOIN text_table ON Message_index.message_id=text_table.message_id
INNER JOIN image_table ON Message_index.message_id=image_table.Message_id