我正在使用下面的查询,它工作正常,但我想从两个平均值也得到4个表如何从使用4个表中的数据连接
$query = mysql_query("SELECT ml.UserID,ml.ContentAddedDateTime,cat.ContentType,cat.ContentTitle,cat.ContentSource,cat.ContentDescription
FROM LibraryMaster as ml
LEFT JOIN CatalogMaster cat ON cat.CatalogID=ml.CatalogID");
我想利用类别从两个表中的数据CategoryLookUp和subCategoryTitle从SubCategoryLook
这里是CatalogMaster表
CatalogID int(11) No auto_increment
CategoryID int(11) No
SubCategoryID int(11) No
ContentType varchar(10) utf8_general_ci No
ContentTitle varchar(25) utf8_general_ci No
AddedByUserID int(11) No
ContentDescription varchar(250) utf8_general_ci Yes NULL
ContentSource varchar(250) utf8_general_ci No
ContentAddedDateTime
这里是CatgeoryLookUp
CategoryID int(11) No auto_increment
CategoryTitle varchar(100) utf8_general_ci No
CategoryDescription varchar(250) utf8_general_ci Yes NULL
CategoryAddedByUserID int(11) No
CategoryAddedDateTime
这里是SubCatLookUp
SubCategoryID int(11) No auto_increment
LinkedCategoryID int(11) No
SubCategoryTitle varchar(100) utf8_general_ci No
SubCategoryAddedDateTime timestamp ON UPDATE CURRENT_TIMESTAMP No CURRENT_TIMESTAMP
SubCategoryAddedByUserID
什么是你有麻烦吗? – peterm
显示你的表格结构。 –
提供表格结构和关系 – chetan