我正試圖在Access中進行更新查詢。我有兩位老師在不同的數據庫中擁有相同的數據表,但他們自己輸入的信息除外。除了他們單獨輸入的信息之外,一切都是一樣的。我正在嘗試合併他們的兩個tblDemographics表格,以便他們可以看到彼此做了什麼,以防學生搬到他們所覆蓋的學校之一。我想知道是否我必須基本輸入每個必須更新的字段,或者是否有一些空格可以使我能夠在哪裏基本說出空位,更新到同名字段?蠻力是訪問中進行更新查詢的唯一方法嗎?
對不起,如果這沒有意義。我只是想看看是否有更有效的方法來做到這一點。
UPDATE tbleDemographics LEFT JOIN tbleDemographics1 ON tbleDemographics.[Local ID] = tbleDemographics1.[Local ID] SET tbleDemographics.FName = [tbleDemographics1.Fname], tbleDemographics.LName = [tbleDemographics1.LName], tbleDemographics.MName = [tbleDemographics1.MName]
WHERE (((tbleDemographics.FName) Is Null) AND ((tbleDemographics.LName) Is Null) AND ((tbleDemographics.MName) Is Null) AND ((tbleDemographics.ClMgr) Is Null) AND ((tbleDemographics.School) Is Null) AND ((tbleDemographics.Grade) Is Null) AND ((tbleDemographics.[Prim Dis]) Is Null) AND ((tbleDemographics.[Sec Dis]) Is Null) AND ((tbleDemographics.[Third Dis]) Is Null) AND ((tbleDemographics.[Local ID]) Is Null) AND ((tbleDemographics.GTID) Is Null) AND ((tbleDemographics.Status) Is Null) AND ((tbleDemographics.[Homeroom Teacher]) Is Null) AND ((tbleDemographics.[GPS Math Teacher]) Is Null) AND ((tbleDemographics.[Number Worlds Teacher]) Is Null) AND ((tbleDemographics.IntervHMcCain) Is Null) AND ((tbleDemographics.InterMSmith) Is Null) AND ((tbleDemographics.InterALacey) Is Null) AND ((tbleDemographics.InterLDaughtry) Is Null) AND ((tbleDemographics.DelInclusion) Is Null) AND ((tbleDemographics.DelRegEd) Is Null) AND ((tbleDemographics.DelConsult) Is Null) AND ((tbleDemographics.DelRes) Is Null) AND ((tbleDemographics.DelPara) Is Null) AND ((tbleDemographics.[DelMIPull-out]) Is Null) AND ((tbleDemographics.DelMIInc) Is Null) AND ((tbleDemographics.OTServices) Is Null) AND ((tbleDemographics.PTServices) Is Null) AND ((tbleDemographics.OIServices) Is Null) AND ((tbleDemographics.SpServices) Is Null) AND ((tbleDemographics.Notes) Is Null));
這看起來對我的口味太亂了,但我想簡單地說如果可能的話,使我其實沒有資格每個條目。
再看一遍之後,我覺得我在這裏所做的SQL很愚蠢。是的,我發現我把「空白」放在了錯誤的地方,而且我設置的方式基本上覆蓋了所有......哎呀。我希望儘管這個總體想法是可以理解的。
好的...現在我越來越多地進入這個數據庫試圖自己弄清楚這個......我看到很多問題,它甚至不好笑。這個數據庫被設置成可怕的地方,它是一個噩夢...如果任何人仍然可以想出我的一般想法,那將是非常值得讚賞的。
數據庫合併=死亡。你必須處理重要的碰撞,刪除和其他許多噩夢。 –
是啊,老師應該照顧他們自己的所有數據,但不知何故他們認爲我之前的人應該是他們的永久助手....所以...現在我必須這樣做。 –
數據庫之間是否有很多共同的數據,或只是結構? –