Oracle under Common Query UPDATE command (ID number to judge men and women, update the statement Multi-table query)

Source: Internet
Author: User

1.update data

UPDATESET= (selectfromwhere t.xh=  b.vlbi_ XH)wherelike'14%';

2. Judging men and women according to their ID numbers

 Decode (mod (To_number (substr (  ID number  ', 17, 1) ", Span style= "color: #800000; Font-weight:bold; " >2), 0, 2 "" 1 ") 
A. Intercept the second-to-last digit of the ID first
B. is divisible by 2
C. If the remainder is 0, Then 2-female
D. If the remainder is not 0, then 1-male
Select decode (mod (To_number (substr (' ID number ')12 0 ' 2 ' ' 1 ' )  from dual

Oracle under Common Query UPDATE command (ID number to judge men and women, update the statement Multi-table query)

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.