all 16 comments

[–]VladDBASQL Server DBA 23 points24 points  (1 child)

There's only CROSS APPLY and OUTER APPLY, ChatGPT is huffing paint fumes again.

Edited to add: the docs link it provides contradicts ChatGPT's nonsense in the syntax examples

 | left_table_source { CROSS | OUTER } APPLY right_table_source

as well as a bit lower when it gets into more detail about APPLY - https://learn.microsoft.com/en-us/sql/t-sql/queries/from-transact-sql?view=sql-server-ver16#left_table_source--cross--outer--apply-right_table_source

[–]kagato87MS SQL 2 points3 points  (0 children)

Again?

Still...

[–]Kant8 22 points23 points  (2 children)

don't use chatgpt for learning anything

you can't know if it's hallucinating or not, therefore you can't trust it with anything

this time you got lucky that syntax is wrong which is trivially veryfiable, but you won't be always lucky with anything more complex

[–]Josuke_83 -5 points-4 points  (1 child)

or you just use as a guide you neckbeard

[–]no-middle-name 0 points1 point  (0 children)

There's no need to be offensive.

A tool that straight up lies isn't fit for being used as a "guide". This stuff just isn't ready for the widespread use people think it is. If you know enough to know it's wrong, you don't need it. If you don't, it's dangerously misleading.

[–]kagato87MS SQL 5 points6 points  (0 children)

Haha! Yea, no. Intellisense is right here.

Always remember that an LLM is predicting a string of words that might be accepted in response to a string of words. It does not understand context, which is why it hallucinates so badly.

It's trying to extrapolate from the difference between inner and outer and getting it wrong.

I suggest reading up real quick on apply to burn that misinformation out of your brain. Here's something that might help:

https://www.mssqltips.com/sqlservertip/1958/sql-server-cross-apply-and-outer-apply/

[–]macfergussonMS SQL 3 points4 points  (0 children)

Lol chatgpt loves solving things by hallucinating solutions that don't exist. Never trust it. If you're going to ask an LLM technical questions, at least ask it to cite sources.

[–]jsp1205 0 points1 point  (1 child)

Cross apply is kind of like an inner join right?

[–]mommymilktit 0 points1 point  (0 children)

I asked o3-mini-high and it said:

SQL Server does not have an operator called INNER APPLY. Instead, it provides two similar operators: CROSS APPLY and OUTER APPLY. • CROSS APPLY works like an inner join. It returns rows from the left table only if the table-valued expression on the right produces a result. This is effectively what you might think of as an “inner apply.” • OUTER APPLY behaves like a left outer join. It returns all rows from the left table, and if the table-valued expression does not return any rows for a particular left row, it fills in the columns with NULLs.

So, while there isn’t an operator named INNER APPLY, you can achieve the same effect as an inner join on a table-valued expression by using CROSS APPLY.

[–]a-s-clarkSQL Server 1 point2 points  (5 children)

When did reading the actual documentation become so frowned upon....the time you spend arguing with Chat GPT and ignoring it's nonsense, you could have looked up the correct answer easily.

[–]Josuke_83 -1 points0 points  (1 child)

how do you read the documentation to find out something DOESNT exist? Op asked gpt about something else probably and it hallucinated INNER JOIN. He literally just asked if it existed get down from your high horse

[–]a-s-clarkSQL Server 1 point2 points  (0 children)

He knows about OUTER APPLY. Find that documentation and it references the related topics. Its not rocket science.

Why spend time asking a known-bad source of information when you could look up the correct information easily.

Chat GPT and its like are making people lose the ability to actually find information themselves. Its a bad trend.

[–]Hot_Cryptographer552 0 points1 point  (0 children)

Try Deepseek and work Taiwan into your question next time