数据库日期格式化(事例)




select sum(c.consume_val),v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,v.begin_date,v.end_date,v.is_exist,v.is_seller_del,
v.is_cust_del,v.make_date,s.pic_path,ct.card_category_value
from vip_card_info v,consume_info c,card_pic_store s,seller_card sd,card_category ct
where v.cus_mobile_num = 1
and v.card_id = c.card_id
and v.pic_id = s.pic_id
and v.seller_card_id = sd.seller_card_id
and ct.card_category = sd.card_category
group by v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,v.begin_date,v.end_date,v.is_exist,v.is_seller_del,
v.is_cust_del,v.make_date,s.pic_path,ct.card_category_value



select sum(c.consume_val) val,v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,date_format(v.begin_date,'%Y/%m/%d')beginDate,
date_format(v.end_date,'%Y/%m/%d') endDate,v.is_exist,v.is_seller_del,
v.is_cust_del,date_format(v.make_date,'%Y/%m/%d')makeDate,s.pic_path,ct.card_category_value
from vip_card_info v,consume_info c,card_pic_store s,seller_card sd,card_category ct
where v.cus_mobile_num = 1 and v.card_id = c.card_id and v.pic_id = s.pic_id
and v.seller_card_id = sd.seller_card_id and ct.card_category = sd.card_category
group by v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,v.begin_date,v.end_date,v.is_exist,v.is_seller_del,
v.is_cust_del,v.make_date,s.pic_path,ct.card_category_value

select sum(c.consume_val),v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,v.begin_date,v.end_date,v.is_exist,v.is_seller_del,
v.is_cust_del,v.make_date,s.pic_path,ct.card_category_value
from vip_card_info v,consume_info c,card_pic_store s,seller_card sd,card_category ct
where v.cus_mobile_num = 1
and v.card_id = c.card_id
and v.pic_id = s.pic_id
and v.seller_card_id = sd.seller_card_id
and ct.card_category = sd.card_category
group by v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,v.begin_date,v.end_date,v.is_exist,v.is_seller_del,
v.is_cust_del,v.make_date,s.pic_path,ct.card_category_value



select sum(c.consume_val) val,v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,date_format(v.begin_date,'%Y/%m/%d')beginDate,
date_format(v.end_date,'%Y/%m/%d') endDate,v.is_exist,v.is_seller_del,
v.is_cust_del,date_format(v.make_date,'%Y/%m/%d')makeDate,s.pic_path,ct.card_category_value
from vip_card_info v,consume_info c,card_pic_store s,seller_card sd,card_category ct
where v.cus_mobile_num = 1 and v.card_id = c.card_id and v.pic_id = s.pic_id
and v.seller_card_id = sd.seller_card_id and ct.card_category = sd.card_category
group by v.mobile_num,v.cus_mobile_num,v.card_num,v.car_num,v.old_card_value,
v.card_value,v.recharge_money,v.begin_date,v.end_date,v.is_exist,v.is_seller_del,
v.is_cust_del,v.make_date,s.pic_path,ct.card_category_value

你可能感兴趣的:(数据库)