You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for this problem, but if statement is like: :
insert into table_A
(
x
,y
)
SELECT
B.xb
,B.yb
FROM table_b B
;
insert into table_A
(
x
,y
)
SELECT
C.xc
,C.yc
FROM table_c C
;
The results should be:
A.x <- B.xb
A.y <- B.yb
A.x <- C.xc
A.y <- C.yc
but the real results is :
A.x <- B.xb
A.y <- B.yb
A.xc <- C.xc
A.yc <- C.yc
Only the result of the first stmt is right.
Maybe this problem will lead to wrong results.
Then I add AS and solve this prolem:
insert into table_A
(
x
,y
)
SELECT
B.xb AS x
,B.yb AS y
FROM table_b B
;
insert into table_A
(
x
,y
)
SELECT
C.xc AS x
,C.yc AS y
FROM table_c C
;
The results now is right:
A.x <- B.xb
A.y <- B.yb
A.x <- C.xc
A.y <- C.yc
The text was updated successfully, but these errors were encountered:
nickhuang1996
changed the title
sql with UNION ALL has incorrect results?
sql with two source tables has incorrect results?
Mar 6, 2023
nickhuang1996
changed the title
sql with two source tables has incorrect results?
sql with more than one source tables has incorrect results?
Mar 6, 2023
nickhuang1996
changed the title
sql with more than one source tables has incorrect results?
sql with more than one source tables sometimes has incorrect results?
Mar 6, 2023
Sorry for this problem, but if statement is like: :
The results should be:
A.x <- B.xb
A.y <- B.yb
A.x <- C.xc
A.y <- C.yc
but the real results is :
A.x <- B.xb
A.y <- B.yb
A.xc <- C.xc
A.yc <- C.yc
Only the result of the first stmt is right.
Maybe this problem will lead to wrong results.
Then I add AS and solve this prolem:
The results now is right:
A.x <- B.xb
A.y <- B.yb
A.x <- C.xc
A.y <- C.yc
The text was updated successfully, but these errors were encountered: