处理多个表并在获取表记录时出现问题
引荐历史记录表:
钱包表:
我当前的MySql查询:
$qry="SELECT * FROM `ci_referal_history` as rh,`ci_scratch_cards` as sc WHERE rh.`referal_id`=sc.`clt_id` AND rh.`referal_id`='".$this->session->userdata('inv_clt_id')."' AND sc.`clt_id`='".$this->session->userdata('inv_clt_id')."' ORDER BY rh.`added_date`,sc.`sent_date` DESC";
获得如下所示的O / P:
但是现在我想显示如下记录:
SR.NO. | Credited Through | Credit
1 | Referral | 51
2 | Scratch Card | 3
所以请您提出查询建议
我要按日期降序排列
是否可以通过mysql-join ..