私はユーザテーブルで自分のuser_currenciesテーブルにLEFTを参加させようとしていますが、その方法はわかりません。 は、私はテーブル2つのテーブルを一緒に追加します。同じテーブル名でも内容は異なります
users with: users.id, users.username, users.password, etc,
を持っていると私は、テーブルを持っている:
user_currencies with
user_currencies.user_id (= users.id), user_currencies.type = 5, user_currencies.type = 10
with user_currencies.amount = 200 for example
私は追加したい:
user_currencies.amount with user_currencies.type = 5 to: users.diamonds (alias)
を。
And user_currencies.amount with user_currencies.type = 10 to: users.duckets (alias).
どのようにすればよいのですか?
これが私の現在のテーブル構造です:
テーブルを追加するとどういう意味ですか?いくつかのサンプルデータと取得しようとしている結果を共有できますか? – Mureinik
両方のテーブルで異なる列(外部キーなし)。あなたは列名を追加できますか? – Blasanka
私はそれを忘れて申し訳ありませんでした(users.id = user_currencies.user_id) –