Skip to content

SELECT unable to use * when using JOIN on MSSQL #25

@saklanipankaj

Description

@saklanipankaj
SELECT *
FROM t1
JOIN t2 ON t1.a = t2.a
JOIN t3 ON t1.a = t3.a;

HResult 0x4E21, Level 16, State 1
One or more errors occurred. (Input string was not in a correct format.)

SELECT t1.a, t2.a, t3.b
FROM t1
JOIN t2 ON t1.a = t2.a
JOIN t3 ON t1.a = t3.a;

a a b


              12                   12                    1
              12                   12                    1
              12                   12                    1
              12                   12                    1
              12                   12                    1
              12                   12                    1

(6 rows affected)

Error is returned when (*) is used in the SELECT statement with a JOIN, however, it is not present when columns are specified. This holds true for using JOIN on 1 or 2 different tables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions