Select name_izd, (Select Top(1) name_book from First_table f_t Where f_t.id_izd=s_t.id Order by id_izd, count_pages desc) As [count_pages] from Second_table s_t
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!