I’m working on a website in which I should take data from a user then show him the tasks he should make at the day based on his career info
I have two main tables at the database “Manager” and “Worker”.
When the user enter his data, his returned id should show What his type is.
Then I take the id and the date and get the day’s tasks.
What I’m thinking at is making a condition to check whether this id is found at the Manager table & if it’s found it’ll retrieve the related tasks, or else it’ll retrieve the tasks related to the Worker.
But I never write a condition at a SPROC before and all what i find is if x = < > … etc (which is not what I want).
SO, would it be possible if you told me how it’s written or if there is any useful tutorials or articles that mentions similar situation ?
Thanks a lot.
Try something like this:
I think that’s what you asked for, so now I’ll add my own two cents. I don’t know if you’re able to edit the schema at all, but wouldn’t it make more sense to put the managers and workers in a single table and add a type column? If you did it that way none of this would be necessary.