Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql with more than one source tables sometimes has incorrect results? #333

Closed
nickhuang1996 opened this issue Mar 6, 2023 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@nickhuang1996
Copy link

nickhuang1996 commented Mar 6, 2023

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

@nickhuang1996 nickhuang1996 changed the title sql sql with UNION ALL has incorrect results? Mar 6, 2023
@nickhuang1996 nickhuang1996 changed the title sql with UNION ALL has incorrect results? sql with two source tables has incorrect results? Mar 6, 2023
@nickhuang1996 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 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
@reata reata added the duplicate This issue or pull request already exists label Mar 7, 2023
@reata
Copy link
Owner

reata commented Mar 7, 2023

This is a duplicate of #212 . We don't officially support this feature for the moment. Please watch that issue for any update.

@reata reata closed this as completed Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants