私は一つにこれらの2つのクエリを達成するために探しています:1つの単一のmysqlクエリで列の値に基づいて列の値を取得する方法は?
SELECT category_uri, parent_id FROM categories where ID = 2
// the output of the above query is that category_uri is "men" and parent_id is 1, which i now will use in another query:
SELECT category_uri FROM categories where ID = 1
// the output of this is category_uri "jackets"
私は今、ID 2に基づいて、それを言うことができ、完全なカテゴリのURIはmen/jackets
である。しかし、代わりにそのような2つのクエリの、どこI parent_idの値を次のものに渡しますが、これはより単純で効率的な方法ではできませんか?