VFP9.0中用ALLT()的怪現象
CREATE SQL VIEW V_TEMP_PARTNO1 AS SELE PART_NO.*;FROM CMADE!PART_NO INNER JOIN CMADE!FILELIST ON UPPER(ALLTRIM(PART_NO.料號))=ALLTRIM(UPPER(FILELIST.關鍵字));
WHERE UPPER(ALLTRIM(FILELIST.文件類別))="工程料號" .AND. ALLT(UPPER(FILELIST.審核狀況))<>"Y";
ORDER BY PART_NO.料號
注:以上這一段查出不任何數據
CREATE SQL VIEW V_TEMP_PARTNO1 AS SELE PART_NO.*;
FROM CMADE!PART_NO INNER JOIN CMADE!FILELIST ON UPPER(ALLT(PART_NO.料號))=ALLTRIM(UPPER(FILELIST.關鍵字));
WHERE UPPER(ALLTRIM(FILELIST.文件類別))="工程料號" .AND. UPPER(FILELIST.審核狀況)<>"Y";
ORDER BY PART_NO.料號
注:以上這一段可以得到兩條符合的記錄
CREATE SQL VIEW V_TEMP_PARTNO1 AS SELE PART_NO.*;
FROM CMADE!PART_NO INNER JOIN CMADE!FILELIST ON UPPER(ALLTRIM(PART_NO.料號))=ALLTRIM(UPPER(FILELIST.關鍵字));
WHERE UPPER(ALLTRIM(FILELIST.文件類別))="工程料號" .AND. EMPT(FILELIST.審核狀況)=.T.;
ORDER BY PART_NO.料號
注:以上這一段可以得到兩條符合的記錄
CREATE SQL VIEW V_TEMP_PARTNO1 AS SELE PART_NO.*;
FROM CMADE!PART_NO INNER JOIN CMADE!FILELIST ON UPPER(ALLT(PART_NO.料號))=ALLTRIM(UPPER(FILELIST.關鍵字));
WHERE UPPER(ALLTRIM(FILELIST.文件類別))="工程料號" .AND. UPPER(FILELIST.審核狀況)="Y";
ORDER BY PART_NO.料號
注:以上這一段可以得到很多條符合的記錄
真的無比的驚訝,為什麼增加一個ALLT(刪除空字符,我用LTRI加上RTRI替換也是一樣的效果)就沒有記錄產生?在SQL語句中,是如何對空串操作及對運算符<>是如何進行比對的?
PS:數據源的"審核狀況"字段為字符型的空串,EXAC設置的是精確比較
[ 本帖最后由 GEORGECHIN 于 2009-9-5 01:26 编辑 ]