init
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
IF OBJECT_ID('[dbo].fnGetTanuloOztalyaAdottIdopontban') IS NOT NULL BEGIN
|
||||
DROP FUNCTION dbo.fnGetTanuloOztalyaAdottIdopontban
|
||||
END
|
||||
GO
|
||||
CREATE FUNCTION dbo.fnGetTanuloOztalyaAdottIdopontban (@tanuloId int, @datum date)
|
||||
RETURNS VARCHAR(255)
|
||||
BEGIN
|
||||
DECLARE @value NVARCHAR(255) = NULL
|
||||
|
||||
SELECT TOP 1 @value = C_NEV FROM T_OSZTALYCSOPORT_OSSZES
|
||||
INNER JOIN T_TANULOCSOPORT_OSSZES ON T_TANULOCSOPORT_OSSZES.C_OSZTALYCSOPORTID = T_OSZTALYCSOPORT_OSSZES.ID
|
||||
AND T_TANULOCSOPORT_OSSZES.C_TANULOID = @tanuloId AND T_TANULOCSOPORT_OSSZES.TOROLT = 'F'
|
||||
AND T_TANULOCSOPORT_OSSZES.C_BELEPESDATUM <= @datum AND (C_KILEPESDATUM >= @datum OR C_KILEPESDATUM IS NULL)
|
||||
INNER JOIN T_OSZTALY_OSSZES ON T_OSZTALY_OSSZES.ID = T_TANULOCSOPORT_OSSZES.C_OSZTALYCSOPORTID
|
||||
|
||||
|
||||
RETURN @value
|
||||
|
||||
END
|
||||
Reference in New Issue
Block a user