What I'm trying to do should be very simple, but for some reason I cannot find the right answer to my problem. I asked something like this in the past, but the answer I was given earlier no longer meets the requirements. So, here's what happens - I need to conditionally select values from a table in my database, unlike the usual way, for example:
Table:
- Id int (not null)
- ParentId int (not null)
- EventOn DateTime (not null)
- User int (null)
Next choice:
SELECT RST.* FROM RangeSheetTime RST
WHERE RST.[User] is not null
(in the case above, I take all the lines where the user is not zero)
Select RST.* FROM RangeSheetTime RST
WHERE RST.[User] is null
(in the above case, I take all the rows where the user is null)
, ? select, , EventOn < GETDATE() , USER . - , USER , , NULL, .
?
. , , .
EDIT:
. , 3 ParentId, 31.
2 StartOrEnd, 1. ,
1- USER ; , USER 90.
StartOrEnd, 0.
startorend. .
startorend, , USER, null, null,
startorend. , , . , .