I do not want to try to use JOIN when I can easily solve the same problem using an internal query:
eg.
SELECT COLUMN1, ( SELECT COLUMN1 FROM TABLE2 WHERE TABLE2.ID = TABLE1.TABLE2ID ) AS COLUMN2 FROM TABLE1;
My question is: is this a bad programming practice? Itβs easier for me to read and support, rather than join.
UPDATE
I want to add that there is excellent feedback here, which essentially pushes back to using JOIN. I find myself less and less connected with using TSQL directly these days based on the results of ORM solutions (LINQ to SQL, NHibernate, etc.), but when I do this, such as correlated subqueries that seem to me, itβs easier to enter linearly .
sql-server
Keith adler
source share