SELECT *
FROM
(
SELECT col1, col2, date_column
FROM table1
UNION ALL
SELECT col1, col2, date_column
FROM table2
) AS combined_tables
WHERE date_column >= '2022-02-01' AND date_column <= '2022-02-28';
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace YourNamespace
{
[ApiController]
[Route("api/data")]
public class DataController : ControllerBase
{
[HttpGet]
public ActionResult<IEnumerable<DataModel>> GetData(string month)
{
// 根据选择的月份查询数据库或其他数据源,获取相应的数据
var data = new List<DataModel>
{
new DataModel { Month = "2022-01", Value = 100 },
new DataModel { Month = "2022-02", Value = 150 },
new DataModel { Month = "2022-