PHP Mysql选择在哪里和之后的地方

Is it possible to select from a DB where equals to and from that result where equals to? In my case I want to select the values profile.vid and afterwards from there select where profile.vid equals "1" - I hope, You understand my point!?

$query
        ->select ($db->quoteName(array('a.id','a.name', 'c.profile_value','c.profile_key')))
        ->from ($db->quoteName('#__users','a'))
        ->where ($db->quoteName('c.profile_key') . " = " . $db->quote('profile.vid'))
        ->where ($db->quote('profile_value') . " = \"1\" " )
        ->join('INNER', $db->quoteName('#__user_profiles','c').'ON('.$db->quoteName('a.id').'='.$db->quoteName('c.user_id').')')
        ->order($db->quoteName('a.name').'ASC')
     ;