Development of a compatible database development platform to solve ifnull, isnull functions in cross-database issues.

Source: Internet
Author: User
Tags database issues

and the SQL statements adapted to each database.

The most recent platform system (Programmer's own platform for the development of other pages) is always cross, make our SQL to change, now boss ideas are compatible, so this need to the database of the exclusive function.

Then you get a problem with this SQL "

Select D.data_group_key,ifnull (L.data_group_value,d.data_group_key) Data_group_value,d.remark
From Ctrl_data_group D .......

Ifnull (MySQL), isnull (SQL Server).

The requirement is to avoid slow performance when changing, you can not change a lower background running speed.

Focus, began to find information on the Internet, post for the great God. Then find the following two points

1, write two sets of SQL, on the configuration file (before the project has two sets of SQL). BE rejected!!! The reason is that every request from your receptionist goes through a configuration file to make the program slow.

2, to check the results are written out, and then in the controller layer to do processing, the requested data is more than one word, after two loop traversal, if the request value is NULL, replace it. BE rejected!!! Looping through twice or the same problem as above.

Almost three or four days of appearance, can not find the right. Tokyu

Later boss can not see down, hand pointing, appeared a third program.

3, instance its query field, in the entity inside judgment. It's too easy to finish a look. I will directly

The request type is changed to the address of the entity class. If the data is empty, use a different value instead of the data or list to receive the SPRING+SPRINGMVC.

Previous SQL

Change SQL

Development of a compatible database development platform to solve ifnull, isnull functions in cross-database issues.

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.