SELECT TOP 5 y.ClassEName,y.savefilepath, j.FileName, j.Title,j.headnewspath, j.AddDate,j.PicPath FROM [FS_NewsClass ] AS y LEFT JOIN [FS_News ] AS j ON y.ClassID = j.ClassID WHERE (y.ParentID in (0612271615431277,06122716311997437) and j.picNewsTF=1 order by j.adddate desc
SELECT TOP 5 y.ClassEName,y.savefilepath, j.FileName, j.Title,j.headnewspath, j.AddDate,j.PicPath
FROM [FS_NewsClass ] y LEFT JOIN [FS_News ] j ON y.ClassID = j.ClassID
WHERE (y.ParentID in (0612271615431277,06122716311997437) and j.picNewsTF=1 order by j.adddate desc表名 不用 as
SELECT TOP 5 y.ClassEName,y.savefilepath,j.FileName, j.Title,j.headnewspath, j.AddDate,j.PicPath
FROM FS_NewsClass y
LEFT JOIN FS_News j
ON y.ClassID = j.ClassID
WHERE y.ParentID in ('0612271615431277','06122716311997437')
and j.picNewsTF=1 order by j.adddate desc
try
=======================
SELECT TOP 5
y.ClassEName,
y.savefilepath,
j.FileName,
j.Title,j.headnewspath,
j.AddDate,
j.PicPath
FROM FS_NewsClass y LEFT JOIN FS_News j
ON y.ClassID = j.ClassID
WHERE
y.ParentID in ('0612271615431277','06122716311997437')
and j.picNewsTF = 1
order by j.adddate descin() 要用 for example : in ('2145','454554')
y.ClassEName,y.savefilepath,
j.FileName, j.Title,j.headnewspath,
j.AddDate,j.PicPath
FROM [FS_NewsClass] AS y LEFT JOIN [FS_News ] AS j
ON y.ClassID = j.ClassID
WHERE y.ParentID in (0612271615431277,06122716311997437) --在这多了个'('
and j.picNewsTF=1
order by j.adddate desc--还有一点 y.ParentID 是字符型的话,后面的值加上单引号
where 后面多一个 “(”