Add a default value for database queries

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/TreeShu321/article/details/101555955

Add a default value for database queries

Scene: We are doing a database query time, you may experience required need to return to a default value.

If we query a user in the table, need to return to a fixed number of such institutions org, we can achieve through sql statement.

	select (242) as amedOrg,catname from user;

Results of the:
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/TreeShu321/article/details/101555955