, , -
if "foo" "foovalues" " " "...."
,
CommentID ArticleID
UserType
Declare TestUserType varchar(3);
select * from Comments where ArticleID = <inputid>; //Returns the comments
select TestUserType = UserType from Users where UserID = <inputuser>; //Returns the usertype for a user and assigns it to a variable
if TestUserType = 'foo'
begin
select * from FooValues;
end
else
begin
select * from FinalValues;
end
: SQL mySQL, , , , SQL .
SQL - , mySQL , , , -