MySQL data type conversion function use of cast vs. convert

Source: Internet
Author: User

<!--get all the recommended merchants in the current city--
<select id= "Findallrecommendsupplier" resulttype= "Java.util.Map" >
SELECT s.supplier_id as SupplierId, s.main_products as Mainproducts
, s.group_id as groupid,s.head_url as Supplierhead,
S.repair_center_name as repaircentername,s.shop_url as Shopurl
, S.manager_phone as Managerphone, S.service_tel as Servicetel,
S.pro_name as Proname, s.city_name as CityName, s.area_name as
AreaName, s.detailed, shop_profile as shopprofile,s.company as
Suppliername,s.head_url as Headurl
From W_supplier_sort W
Left JOIN s_supplier s on w.supplier_id = s.supplier_id
Left JOIN s_user u on w.supplier_id = U.id
WHERE s.city_number = #{citynumber,jdbctype=varchar} and
Unix_timestamp (now ()) *1000 &lt; S.end_time
And s.main_products is not NULL and u.user_state = 0 and u.account_state = 0
ORDER by CONVERT ((Sell_number/#{sellsum,jdbctype=bigint} * #{sellfaciend,jdbctype=decimal} +
Call_number/#{callsum,jdbctype=bigint} * #{callfaciend,jdbctype=decimal}), DECIMAL (18,10))
DESC
</select>

MySQL data type conversion function use of cast vs. convert

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.