SQL statement Intercept string

Source: Internet
Author: User

Case is left (t5.name,2) = ' substring ' and then ' (t5.name,9,2) Else substring (t5.name,7,2) End GD

Intercept pre-1~10 digits ac17072408

Select substring (name,0,11) from Profin_application;

name=ac1707240801


Select substring (name,0,11) from Profin_application;
Select Left (name,10) from Profin_application;

Select T1.name, Timeadd (' Hour ', 8,t1.date), T3.name_template, left (t3.name_template,3), substring (t3.name_ template,6,3) number, t4.material, T4.cust_spec,
T5.name, Case is left (t5.name,2) = ' "Then substring" (t5.name,3,6) Else left (t5.name,6) End pp,case when left ( t5.name,2) = ' then substring (t5.name,9,2) Else substring (t5.name,7,2) End GD, right (t5.name,3), T6.name, T8.name, T2.lqty
From mrp_production_report T1
Left join Mrp_production_report_line T2 on t1.id=t2.line_id
Left join product_product T3 on T2.lproduct_id=t3.id
Left join product_template T4 on T3.product_tmpl_id=t4.id
Left join Mrp_production_report_lot T5 on t5.id=t2.lot_id
Left join Mrp_routing_workcenter T6 on T6.id=t2.lprocedure
Left join Res_users T7 on T7.id=t2.lemployee
Left join Res_partner T8 on t8.id=t7.partner_id
where t2.lstate=2 and t6.name= ' sorting ' or t6.name= ' wrapper ' and t1.company_id=4 and t1.date>= ' ${sd} 0:00:00 ' and T1.date<= ' ${ed} 23:59:59 '

SQL statement Intercept string

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.