Database has tables Photos and PhotoAlbums. I need a query that will select all albums and only one photo from each album. I need SQL and LINQ version of this query. Thanks in advance.
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
if the tables are like:
Here is the SQL query:
working example:
OUTPUT:
The Linq query could be something like this:
In Linq I'm not that experienced in it so I'll only give the SQL Server Query
Or This