MySQL Pseudo-column

Source: Internet
Author: User

 
<!--Note:internal_name_trim is using pseudo-columns instead of data returned by the database--
<SelectID= "Listbystoreidandpartsnotrimandbrandname"Resultmap= "Productmap">SELECT product_id, Internal_name_trim from (<foreachCollection= "Productquerys"Item= "Productquery"Separator= "UNION All"Index= "Index">(select product_id, @myInternalName #{index} as Internal_name_trim from product, (select @myIn Ternalname#{index}:= #{productquery.internalnametrim}) r WHERE product_store_id = #{productstoreid} and PARTSN O_trim = #{productquery.partsnotrim} and brand_name = #{productquery.brandname} LIMIT 1)</foreach>) P</Select>

Note:1, limit 1 after the end, be sure to add parentheses, or become a piece of data2, the use of pseudo-column name can not be the same, otherwise all the last data will prevail

MySQL Pseudo-column

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.