私はSQLクラスのプロジェクトで作業しており、ボードゲームMonopolyをベースにしたプロジェクトを行っています。赤いボード上の場所を表示するには、「ユーザー定義変数」を使用する必要があります。ここに私のテーブルstreet_by_color_v
の内容は以下のとおりです。ここでユーザー定義の変数の問題
color_name site_label order_site
purple Mediterranean Avenue 2
purple Baltic Avenue 4
light blue Oriental Avenue 7
light blue Vermont Avenue 9
light blue Connecticut Avenue 10
violet St. Charles Place 12
violet States Avenue 14
violet Virginia Avenue 15
orange St. James Place 17
orange Tennessee Avenue 19
orange New York Avenue 20
red Kentucky Avenue 22
red Indiana Avenue 24
red Illinois Avenue 25
yellow Atlantic Avenue 27
yellow Ventor Avenue 28
yellow Marvin Gardens 30
green Pacific Avenue 32
green North Carolina Avenue 33
green Pennsylvania Avenue 35
royal blue Park Place 38
royal blue Boardwalk 40
は私のコードは次のとおりです。
SET @s_color:='red';
私が実行すると、私はコードを実行します。
SELECT site_label FROM street_by_color_v
WHERE [email protected]_color;
をし、それが動作しません。 。
エラーメッセージがいただければ幸いです。 「うまくいきません」というのは役に立たない。 – spamguy