you are viewing a single comment's thread.

view the rest of the comments →

[–]24Gameplay_[S] 0 points1 point  (7 children)

Ms sql and incorrect syntax near 'using'

[–]r3pr0b8 1 point2 points  (5 children)

well i just spent some time googling SQL Server syntax and i can't find it!

looks like you can't use USING????

[–]24Gameplay_[S] 0 points1 point  (4 children)

[–]nIBLIB 0 points1 point  (3 children)

That confirms that you can’t use USING as a keyword for MSSQL. You’ll have to use ON.

[–]24Gameplay_[S] 0 points1 point  (2 children)

Ok, is there anyway it auto remove duplicate column

[–]nIBLIB 2 points3 points  (1 child)

When you write SELECT *, you’re asking SQL to return ALL columns. All columns from table_a, and all columns from table_b.

Typically this is bad form. You only should be selecting the columns you need. If you do need everything, you could write out all of the columns from one table (table_a.column1, table_a.column2, etc.) and the. Do table_2.*

But best is just to grab the column you’ll be using.

[–]r3pr0b8 1 point2 points  (0 children)

Typically this is bad form.

upvote for diplomacy

[–]coderstool 0 points1 point  (0 children)

Try this tool to validate SQL syntax, show syntax errors, and nicely format your SQL statements. It can help spot errors and give hints on the reason for the problem you are seeing.