Advertisement
olekturbo

Untitled

Feb 26th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. CREATE FUNCTION dbo.najwiecej_spraw () RETURNS VARCHAR(100)
  2. AS
  3. BEGIN
  4. RETURN (SELECT TOP 1 se.imie, se.nazwisko, COUNT(sp.id_sprawa) AS ilosc_spraw FROM
  5. sedzia se INNER JOIN sprawa se ON se.id_sedzia=sp.id_sedzia
  6. GROUP BY se.id_sedzia
  7. ORDER BY ilosc_spraw ASC)
  8. END
  9. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement