开发者

mysql query issue

开发者 https://www.devze.com 2023-01-11 02:42 出处:网络
Let\'s assume I have开发者_开发问答 the below table mysql> desc countrylist; +---------+-------------+------+-----+---------+-------+

Let's assume I have开发者_开发问答 the below table

mysql> desc countrylist;  
+---------+-------------+------+-----+---------+-------+  
| Field   | Type        | Null | Key | Default | Extra |  
+---------+-------------+------+-----+---------+-------+  
| country | varchar(32) | YES  |     | NULL    |       |  
+---------+-------------+------+-----+---------+-------+  
1 row in set (0.02 sec)  

While querying the table, I always want 'USA' in the result whether or not the value is there in the table, in addition to other countries in the table. How do I handle that?

TIA.

James.


You can use UNION:

SELECT country FROM countrylist
UNION
SELECT 'USA'
0

精彩评论

暂无评论...
验证码 换一张
取 消