2017-08-29 68 views
0

我是新來的原始sql查詢。我想知道什麼@之前在mysql中的變量?和<>。這是什麼意思<>和@在mysql之前的變量?

我發現<> notequal意味着,如果是,那麼怎麼樣!=

這裏是我的SQL查詢...

if (@leave_name <> "CL") then 
    select trans_id into @trans_id from emp_leave 
     where emp_id = in_emp_id and leave_name = @leave_name; 
end if; 
+0

'<>'是ANSI SQL,'!='已棄用。 – jarlh

+0

獲得downvote有什麼不對? –

+0

@用於變量,請查看此鏈接:https://dev.mysql.com/doc/refman/5.7/en/user-variables.html –

回答

1

@信號的SQL變量。你可以找到更多關於變量的信息here

<>是「正確」的方式來表示not equal
!=現在已棄用。