Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Help with SQL query

$
0
0

I have a query where I use 8 subqueries to return the data that I need.
I am guessing this is not optimal and is probably horrible on performance.
Here is my scenario simplified:

Table WALL and table POST have a 1 to many relationship.

Table WALL:
id
Name

Table POST:
id
Note
ImageUri

How can I retrieve all WALLs, along with their latest POST id, Note, and ImageUri without specifically getting each one individually in a sub-query?


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>