字段顺序是否在内部联接中对访问SQL很重要?

时间:2017-10-06 14:39:46

标签: sql ms-access join

我有一个查询,要求将一个HUNDRED字段从一个表连接到另一个表。而不是手动通过查询设计器,我决定使用excel构建连接。当我将代码放入查询的SQL端,然后单击设计器时,它会在所有100个字段比较中被阻塞并删除它们。我继续手动点击拖动整个100字段集合将它们全部加入。不知怎的,它奏效了。现在,当我查看sql代码访问的方式时,它看起来几乎与我的代码相同。我可以识别的唯一区别是,它不是从A-Z出发,而是Z-A。 原始查询

PARAMETERS pn TEXT (255)
,tt TEXT (255)
,sns Long
,sne Long
,ds DATETIME
,de DATETIME;

SELECT y.Short_Description1
,y.Data1
,y.Short_Description2
,y.Data2
,y.Short_Description3
,y.Data3
,y.Short_Description4
,y.Data4
,y.Short_Description5
,y.Data5
,y.Short_Description6
,y.Data6
,y.Short_Description7
,y.Data7
,y.Short_Description8
,y.Data8
,y.Short_Description9
,y.Data9
,y.Short_Description10
,y.Data10
,y.Short_Description11
,y.Data11
,y.Short_Description12
,y.Data12
,y.Short_Description13
,y.Data13
,y.Short_Description14
,y.Data14
,y.Short_Description15
,y.Data15
,y.Short_Description16
,y.Data16
,y.Short_Description17
,y.Data17
,y.Short_Description18
,y.Data18
,y.Short_Description19
,y.Data19
,y.Short_Description20
,y.Data20
,y.Short_Description21
,y.Data21
,y.Short_Description22
,y.Data22
,y.Short_Description23
,y.Data23
,y.Short_Description24
,y.Data24
,y.Short_Description25
,y.Data25
,y.Short_Description26
,y.Data26
,y.Short_Description27
,y.Data27
,y.Short_Description28
,y.Data28
,y.Short_Description29
,y.Data29
,y.Short_Description30
,y.Data30
,y.Short_Description31
,y.Data31
,y.Short_Description32
,y.Data32
,y.Short_Description33
,y.Data33
,y.Short_Description34
,y.Data34
,y.Short_Description35
,y.Data35
,y.Short_Description36
,y.Data36
,y.Short_Description37
,y.Data37
,y.Short_Description38
,y.Data38
,y.Short_Description39
,y.Data39
,y.Short_Description40
,y.Data40
,y.Short_Description41
,y.Data41
,y.Short_Description42
,y.Data42
,y.Short_Description43
,y.Data43
,y.Short_Description44
,y.Data44
,y.Short_Description45
,y.Data45
,y.Short_Description46
,y.Data46
,y.Short_Description47
,y.Data47
,y.Short_Description48
,y.Data48
,y.Short_Description49
,y.Data49
,y.Short_Description50
,y.Data50
,y.Short_Description51
,y.Data51
,y.Short_Description52
,y.Data52
,y.Short_Description53
,y.Data53
,y.Short_Description54
,y.Data54
,y.Short_Description55
,y.Data55
,y.Short_Description56
,y.Data56
,y.Short_Description57
,y.Data57
,y.Short_Description58
,y.Data58
,y.Short_Description59
,y.Data59
,y.Short_Description60
,y.Data60
,y.Short_Description61
,y.Data61
,y.Short_Description62
,y.Data62
,y.Short_Description63
,y.Data63
,y.Short_Description64
,y.Data64
,y.Short_Description65
,y.Data65
,y.Short_Description66
,y.Data66
,y.Short_Description67
,y.Data67
,y.Short_Description68
,y.Data68
,y.Short_Description69
,y.Data69
,y.Short_Description70
,y.Data70
,y.Short_Description71
,y.Data71
,y.Short_Description72
,y.Data72
,y.Short_Description73
,y.Data73
,y.Short_Description74
,y.Data74
,y.Short_Description75
,y.Data75
,y.Short_Description76
,y.Data76
,y.Short_Description77
,y.Data77
,y.Short_Description78
,y.Data78
,y.Short_Description79
,y.Data79
,y.Short_Description80
,y.Data80
,y.Short_Description81
,y.Data81
,y.Short_Description82
,y.Data82
,y.Short_Description83
,y.Data83
,y.Short_Description84
,y.Data84
,y.Short_Description85
,y.Data85
,y.Short_Description86
,y.Data86
,y.Short_Description87
,y.Data87
,y.Short_Description88
,y.Data88
,y.Short_Description89
,y.Data89
,y.Short_Description90
,y.Data90
,y.Short_Description91
,y.Data91
,y.Short_Description92
,y.Data92
,y.Short_Description93
,y.Data93
,y.Short_Description94
,y.Data94
,y.Short_Description95
,y.Data95
,y.Short_Description96
,y.Data96
,y.Short_Description97
,y.Data97
,y.Short_Description98
,y.Data98
,y.Short_Description99
,y.Data99
,y.Short_Description100
,y.Data100
,x.rownum
FROM qryIndividualTestData100Descriptions AS x
INNER JOIN IndividualTestData100 AS y ON (x.Short_Description1 = 
y.Short_Description1)
AND (x.Short_Description2 = y.Short_Description2)
AND (x.Short_Description3 = y.Short_Description3)
AND (x.Short_Description4 = y.Short_Description4)
AND (x.Short_Description5 = y.Short_Description5)
AND (x.Short_Description6 = y.Short_Description6)
AND (x.Short_Description7 = y.Short_Description7)
AND (x.Short_Description8 = y.Short_Description8)
AND (x.Short_Description9 = y.Short_Description9)
AND (x.Short_Description10 = y.Short_Description10)
AND (x.Short_Description11 = y.Short_Description11)
AND (x.Short_Description12 = y.Short_Description12)
AND (x.Short_Description13 = y.Short_Description13)
AND (x.Short_Description14 = y.Short_Description14)
AND (x.Short_Description15 = y.Short_Description15)
AND (x.Short_Description16 = y.Short_Description16)
AND (x.Short_Description17 = y.Short_Description17)
AND (x.Short_Description18 = y.Short_Description18)
AND (x.Short_Description19 = y.Short_Description19)
AND (x.Short_Description20 = y.Short_Description20)
AND (x.Short_Description21 = y.Short_Description21)
AND (x.Short_Description22 = y.Short_Description22)
AND (x.Short_Description23 = y.Short_Description23)
AND (x.Short_Description24 = y.Short_Description24)
AND (x.Short_Description25 = y.Short_Description25)
AND (x.Short_Description26 = y.Short_Description26)
AND (x.Short_Description27 = y.Short_Description27)
AND (x.Short_Description28 = y.Short_Description28)
AND (x.Short_Description29 = y.Short_Description29)
AND (x.Short_Description30 = y.Short_Description30)
AND (x.Short_Description31 = y.Short_Description31)
AND (x.Short_Description32 = y.Short_Description32)
AND (x.Short_Description33 = y.Short_Description33)
AND (x.Short_Description34 = y.Short_Description34)
AND (x.Short_Description35 = y.Short_Description35)
AND (x.Short_Description36 = y.Short_Description36)
AND (x.Short_Description37 = y.Short_Description37)
AND (x.Short_Description38 = y.Short_Description38)
AND (x.Short_Description39 = y.Short_Description39)
AND (x.Short_Description40 = y.Short_Description40)
AND (x.Short_Description41 = y.Short_Description41)
AND (x.Short_Description42 = y.Short_Description42)
AND (x.Short_Description43 = y.Short_Description43)
AND (x.Short_Description44 = y.Short_Description44)
AND (x.Short_Description45 = y.Short_Description45)
AND (x.Short_Description46 = y.Short_Description46)
AND (x.Short_Description47 = y.Short_Description47)
AND (x.Short_Description48 = y.Short_Description48)
AND (x.Short_Description49 = y.Short_Description49)
AND (x.Short_Description50 = y.Short_Description50)
AND (x.Short_Description51 = y.Short_Description51)
AND (x.Short_Description52 = y.Short_Description52)
AND (x.Short_Description53 = y.Short_Description53)
AND (x.Short_Description54 = y.Short_Description54)
AND (x.Short_Description55 = y.Short_Description55)
AND (x.Short_Description56 = y.Short_Description56)
AND (x.Short_Description57 = y.Short_Description57)
AND (x.Short_Description58 = y.Short_Description58)
AND (x.Short_Description59 = y.Short_Description59)
AND (x.Short_Description60 = y.Short_Description60)
AND (x.Short_Description61 = y.Short_Description61)
AND (x.Short_Description62 = y.Short_Description62)
AND (x.Short_Description63 = y.Short_Description63)
AND (x.Short_Description64 = y.Short_Description64)
AND (x.Short_Description65 = y.Short_Description65)
AND (x.Short_Description66 = y.Short_Description66)
AND (x.Short_Description67 = y.Short_Description67)
AND (x.Short_Description68 = y.Short_Description68)
AND (x.Short_Description69 = y.Short_Description69)
AND (x.Short_Description70 = y.Short_Description70)
AND (x.Short_Description71 = y.Short_Description71)
AND (x.Short_Description72 = y.Short_Description72)
AND (x.Short_Description73 = y.Short_Description73)
AND (x.Short_Description74 = y.Short_Description74)
AND (x.Short_Description75 = y.Short_Description75)
AND (x.Short_Description76 = y.Short_Description76)
AND (x.Short_Description77 = y.Short_Description77)
AND (x.Short_Description78 = y.Short_Description78)
AND (x.Short_Description79 = y.Short_Description79)
AND (x.Short_Description80 = y.Short_Description80)
AND (x.Short_Description81 = y.Short_Description81)
AND (x.Short_Description82 = y.Short_Description82)
AND (x.Short_Description83 = y.Short_Description83)
AND (x.Short_Description84 = y.Short_Description84)
AND (x.Short_Description85 = y.Short_Description85)
AND (x.Short_Description86 = y.Short_Description86)
AND (x.Short_Description87 = y.Short_Description87)
AND (x.Short_Description88 = y.Short_Description88)
AND (x.Short_Description89 = y.Short_Description89)
AND (x.Short_Description90 = y.Short_Description90)
AND (x.Short_Description91 = y.Short_Description91)
AND (x.Short_Description92 = y.Short_Description92)
AND (x.Short_Description93 = y.Short_Description93)
AND (x.Short_Description94 = y.Short_Description94)
AND (x.Short_Description95 = y.Short_Description95)
AND (x.Short_Description96 = y.Short_Description96)
AND (x.Short_Description97 = y.Short_Description97)
AND (x.Short_Description98 = y.Short_Description98)
AND (x.Short_Description99 = y.Short_Description99)
AND (x.Short_Description100 = y.Short_Description100)
WHERE (
    ((y.[Part_Number]) LIKE [pn] & "*" & [tt])
    AND (
        (y.[Serial_Number]) >= [sns]
        AND (y.[Serial_Number]) <= [sne]
        )
    AND (
        (y.[Test_Date]) >= [ds]
        AND (y.[Test_Date]) <= [de]
        )
    );

访问生成的版本

PARAMETERS pn TEXT (255)
,tt TEXT (255)
,sns Long
,sne Long
,ds DATETIME
,de DATETIME;

SELECT y.Short_Description1
,y.Data1
,y.Short_Description2
,y.Data2
,y.Short_Description3
,y.Data3
,y.Short_Description4
,y.Data4
,y.Short_Description5
,y.Data5
,y.Short_Description6
,y.Data6
,y.Short_Description7
,y.Data7
,y.Short_Description8
,y.Data8
,y.Short_Description9
,y.Data9
,y.Short_Description10
,y.Data10
,y.Short_Description11
,y.Data11
,y.Short_Description12
,y.Data12
,y.Short_Description13
,y.Data13
,y.Short_Description14
,y.Data14
,y.Short_Description15
,y.Data15
,y.Short_Description16
,y.Data16
,y.Short_Description17
,y.Data17
,y.Short_Description18
,y.Data18
,y.Short_Description19
,y.Data19
,y.Short_Description20
,y.Data20
,y.Short_Description21
,y.Data21
,y.Short_Description22
,y.Data22
,y.Short_Description23
,y.Data23
,y.Short_Description24
,y.Data24
,y.Short_Description25
,y.Data25
,y.Short_Description26
,y.Data26
,y.Short_Description27
,y.Data27
,y.Short_Description28
,y.Data28
,y.Short_Description29
,y.Data29
,y.Short_Description30
,y.Data30
,y.Short_Description31
,y.Data31
,y.Short_Description32
,y.Data32
,y.Short_Description33
,y.Data33
,y.Short_Description34
,y.Data34
,y.Short_Description35
,y.Data35
,y.Short_Description36
,y.Data36
,y.Short_Description37
,y.Data37
,y.Short_Description38
,y.Data38
,y.Short_Description39
,y.Data39
,y.Short_Description40
,y.Data40
,y.Short_Description41
,y.Data41
,y.Short_Description42
,y.Data42
,y.Short_Description43
,y.Data43
,y.Short_Description44
,y.Data44
,y.Short_Description45
,y.Data45
,y.Short_Description46
,y.Data46
,y.Short_Description47
,y.Data47
,y.Short_Description48
,y.Data48
,y.Short_Description49
,y.Data49
,y.Short_Description50
,y.Data50
,y.Short_Description51
,y.Data51
,y.Short_Description52
,y.Data52
,y.Short_Description53
,y.Data53
,y.Short_Description54
,y.Data54
,y.Short_Description55
,y.Data55
,y.Short_Description56
,y.Data56
,y.Short_Description57
,y.Data57
,y.Short_Description58
,y.Data58
,y.Short_Description59
,y.Data59
,y.Short_Description60
,y.Data60
,y.Short_Description61
,y.Data61
,y.Short_Description62
,y.Data62
,y.Short_Description63
,y.Data63
,y.Short_Description64
,y.Data64
,y.Short_Description65
,y.Data65
,y.Short_Description66
,y.Data66
,y.Short_Description67
,y.Data67
,y.Short_Description68
,y.Data68
,y.Short_Description69
,y.Data69
,y.Short_Description70
,y.Data70
,y.Short_Description71
,y.Data71
,y.Short_Description72
,y.Data72
,y.Short_Description73
,y.Data73
,y.Short_Description74
,y.Data74
,y.Short_Description75
,y.Data75
,y.Short_Description76
,y.Data76
,y.Short_Description77
,y.Data77
,y.Short_Description78
,y.Data78
,y.Short_Description79
,y.Data79
,y.Short_Description80
,y.Data80
,y.Short_Description81
,y.Data81
,y.Short_Description82
,y.Data82
,y.Short_Description83
,y.Data83
,y.Short_Description84
,y.Data84
,y.Short_Description85
,y.Data85
,y.Short_Description86
,y.Data86
,y.Short_Description87
,y.Data87
,y.Short_Description88
,y.Data88
,y.Short_Description89
,y.Data89
,y.Short_Description90
,y.Data90
,y.Short_Description91
,y.Data91
,y.Short_Description92
,y.Data92
,y.Short_Description93
,y.Data93
,y.Short_Description94
,y.Data94
,y.Short_Description95
,y.Data95
,y.Short_Description96
,y.Data96
,y.Short_Description97
,y.Data97
,y.Short_Description98
,y.Data98
,y.Short_Description99
,y.Data99
,y.Short_Description100
,y.Data100
,x.rownum
FROM qryIndividualTestData100Descriptions AS x
INNER JOIN individualtestdata100 AS y ON (x.Short_Description100 = 
y.Short_Description100)
AND (x.Short_Description99 = y.Short_Description99)
AND (x.Short_Description98 = y.Short_Description98)
AND (x.Short_Description97 = y.Short_Description97)
AND (x.Short_Description96 = y.Short_Description96)
AND (x.Short_Description95 = y.Short_Description95)
AND (x.Short_Description94 = y.Short_Description94)
AND (x.Short_Description93 = y.Short_Description93)
AND (x.Short_Description92 = y.Short_Description92)
AND (x.Short_Description91 = y.Short_Description91)
AND (x.Short_Description90 = y.Short_Description90)
AND (x.Short_Description89 = y.Short_Description89)
AND (x.Short_Description88 = y.Short_Description88)
AND (x.Short_Description87 = y.Short_Description87)
AND (x.Short_Description86 = y.Short_Description86)
AND (x.Short_Description85 = y.Short_Description85)
AND (x.Short_Description84 = y.Short_Description84)
AND (x.Short_Description83 = y.Short_Description83)
AND (x.Short_Description82 = y.Short_Description82)
AND (x.Short_Description81 = y.Short_Description81)
AND (x.Short_Description80 = y.Short_Description80)
AND (x.Short_Description79 = y.Short_Description79)
AND (x.Short_Description78 = y.Short_Description78)
AND (x.Short_Description77 = y.Short_Description77)
AND (x.Short_Description76 = y.Short_Description76)
AND (x.Short_Description75 = y.Short_Description75)
AND (x.Short_Description74 = y.Short_Description74)
AND (x.Short_Description73 = y.Short_Description73)
AND (x.Short_Description72 = y.Short_Description72)
AND (x.Short_Description71 = y.Short_Description71)
AND (x.Short_Description70 = y.Short_Description70)
AND (x.Short_Description69 = y.Short_Description69)
AND (x.Short_Description68 = y.Short_Description68)
AND (x.Short_Description67 = y.Short_Description67)
AND (x.Short_Description66 = y.Short_Description66)
AND (x.Short_Description65 = y.Short_Description65)
AND (x.Short_Description64 = y.Short_Description64)
AND (x.Short_Description63 = y.Short_Description63)
AND (x.Short_Description62 = y.Short_Description62)
AND (x.Short_Description61 = y.Short_Description61)
AND (x.Short_Description60 = y.Short_Description60)
AND (x.Short_Description59 = y.Short_Description59)
AND (x.Short_Description58 = y.Short_Description58)
AND (x.Short_Description57 = y.Short_Description57)
AND (x.Short_Description56 = y.Short_Description56)
AND (x.Short_Description55 = y.Short_Description55)
AND (x.Short_Description54 = y.Short_Description54)
AND (x.Short_Description53 = y.Short_Description53)
AND (x.Short_Description52 = y.Short_Description52)
AND (x.Short_Description51 = y.Short_Description51)
AND (x.Short_Description50 = y.Short_Description50)
AND (x.Short_Description49 = y.Short_Description49)
AND (x.Short_Description48 = y.Short_Description48)
AND (x.Short_Description47 = y.Short_Description47)
AND (x.Short_Description46 = y.Short_Description46)
AND (x.Short_Description45 = y.Short_Description45)
AND (x.Short_Description44 = y.Short_Description44)
AND (x.Short_Description43 = y.Short_Description43)
AND (x.Short_Description42 = y.Short_Description42)
AND (x.Short_Description41 = y.Short_Description41)
AND (x.Short_Description40 = y.Short_Description40)
AND (x.Short_Description39 = y.Short_Description39)
AND (x.Short_Description38 = y.Short_Description38)
AND (x.Short_Description37 = y.Short_Description37)
AND (x.Short_Description36 = y.Short_Description36)
AND (x.Short_Description35 = y.Short_Description35)
AND (x.Short_Description34 = y.Short_Description34)
AND (x.Short_Description33 = y.Short_Description33)
AND (x.Short_Description32 = y.Short_Description32)
AND (x.Short_Description31 = y.Short_Description31)
AND (x.Short_Description30 = y.Short_Description30)
AND (x.Short_Description29 = y.Short_Description29)
AND (x.Short_Description28 = y.Short_Description28)
AND (x.Short_Description27 = y.Short_Description27)
AND (x.Short_Description26 = y.Short_Description26)
AND (x.Short_Description25 = y.Short_Description25)
AND (x.Short_Description24 = y.Short_Description24)
AND (x.Short_Description23 = y.Short_Description23)
AND (x.Short_Description22 = y.Short_Description22)
AND (x.Short_Description21 = y.Short_Description21)
AND (x.Short_Description20 = y.Short_Description20)
AND (x.Short_Description19 = y.Short_Description19)
AND (x.Short_Description18 = y.Short_Description18)
AND (x.Short_Description17 = y.Short_Description17)
AND (x.Short_Description16 = y.Short_Description16)
AND (x.Short_Description15 = y.Short_Description15)
AND (x.Short_Description14 = y.Short_Description14)
AND (x.Short_Description13 = y.Short_Description13)
AND (x.Short_Description12 = y.Short_Description12)
AND (x.Short_Description11 = y.Short_Description11)
AND (x.Short_Description10 = y.Short_Description10)
AND (x.Short_Description9 = y.Short_Description9)
AND (x.Short_Description8 = y.Short_Description8)
AND (x.Short_Description7 = y.Short_Description7)
AND (x.Short_Description6 = y.Short_Description6)
AND (x.Short_Description5 = y.Short_Description5)
AND (x.Short_Description4 = y.Short_Description4)
AND (x.Short_Description3 = y.Short_Description3)
AND (x.Short_Description2 = y.Short_Description2)
AND (x.Short_Description1 = y.Short_Description1)
WHERE (
    ((y.Part_Number) LIKE [pn] & "*" & [tt])
    AND (
        (y.Serial_Number) >= [sns]
        AND (y.Serial_Number) <= [sne]
        )
    AND (
        (y.Test_Date) >= [ds]
        AND (y.Test_Date) <= [de]
        )
    );

为什么访问会阻塞查询?

0 个答案:

没有答案