mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>表:<code>Products</code></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
+-------------+---------+
 | 
						||
| Column Name | Type    |
 | 
						||
+-------------+---------+
 | 
						||
| product_id  | int     |
 | 
						||
| low_fats    | enum    |
 | 
						||
| recyclable  | enum    |
 | 
						||
+-------------+---------+
 | 
						||
<code>product_id</code> 是该表的主键(具有唯一值的列)。
 | 
						||
low_fats 是枚举类型,取值为以下两种 ('Y', 'N'),其中 'Y' 表示该产品是低脂产品,'N' 表示不是低脂产品。
 | 
						||
recyclable 是枚举类型,取值为以下两种 ('Y', 'N'),其中 'Y' 表示该产品可回收,而 'N' 表示不可回收。</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p>编写解决方案找出既是低脂又是可回收的产品编号。</p>
 | 
						||
 | 
						||
<p>返回结果 <strong>无顺序要求</strong> 。</p>
 | 
						||
 | 
						||
<p>返回结果格式如下例所示:</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>
 | 
						||
Products 表:
 | 
						||
+-------------+----------+------------+
 | 
						||
| product_id  | low_fats | recyclable |
 | 
						||
+-------------+----------+------------+
 | 
						||
| 0           | Y        | N          |
 | 
						||
| 1           | Y        | Y          |
 | 
						||
| 2           | N        | Y          |
 | 
						||
| 3           | Y        | Y          |
 | 
						||
| 4           | N        | N          |
 | 
						||
+-------------+----------+------------+
 | 
						||
<strong>输出:</strong>
 | 
						||
+-------------+
 | 
						||
| product_id  |
 | 
						||
+-------------+
 | 
						||
| 1           |
 | 
						||
| 3           |
 | 
						||
+-------------+
 | 
						||
<strong>解释:</strong>
 | 
						||
只有产品 id 为 1 和 3 的产品,既是低脂又是可回收的产品。
 | 
						||
</pre>
 |