½Ð°Ý§Ú¦³¤@¸ê®ÆªíÄæ¦ì¦³ , [¤½¥qID] , [¦~], [¤ë], [·í¤ëÀ禬], [·í¤ë²ÖpÀ禬]
[¤½¥qID] , [¦~], [¤ë]¬°²Õ¦XÁä
§Ú°µ¤@Ó¬d¸ßªí¨Ópºâ À禬¤ë¦¨ªø²v
»yªk¥Î¥H¤USQL
SELECT a.[¤½¥qID], a.[¦~], a.[¤ë], a.[·í¤ëÀ禬], a.[·í¤ë²ÖpÀ禬],
(a.[·í¤ëÀ禬]-b.[·í¤ëÀ禬])*100/b.[·í¤ëÀ禬] AS ¤ë¦¨ªø²v
FROM ¤ëÀ禬ªí AS a
LEFT JOIN ¤ëÀ禬ªí AS b
ON (a.[¤½¥qID] = b.[¤½¥qID] and a.[¦~] = b.[¦~] and a.[¤ë]-1 = b.[¤ë] )
or (a.[¤½¥qID] = b.[¤½¥qID] and a.[¦~]-1 = b.[¦~] and a.[¤ë]=1 and b.[¤ë]=12 );
¦ý¸ê®ÆÀ˵ø®ÉÅܱo«ÜºC , ·Q°Ý¬O¤£¬OSQL»yªk®Ä²v³y¦¨ªº
pºâ¦¨ªø²vn«ç»ò¼g·|¤ñ¸û¦n? |