From surenkid, 3 Months ago, written in MySQL.
Embed
  1. SELECT o.oid,FROM_UNIXTIME(o.paytime) paytime ,vipid,vipname,vipmobile,vipaddress,o.totalnum,o.totalprice
  2. FROM wfx_shop_order o
  3. LEFT JOIN wfx_vip v ON o.vipid = v.id
  4. LEFT JOIN wfx_vip vv ON SUBSTRING(SUBSTRING_INDEX(v.path,"-",2),3) = vv.id
  5. WHERE o.ispay = 1 AND o.id>9642
  6. AND vv.mobile = '13964107708'