You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

前端动态传递列名至SQL查询的业务实现需求

功能需求与SQL生成规则

核心需求

  • 数据表包含10列,前端以10列网格形式展示,每列对应一个独立搜索框
  • 用户在任意列的搜索框输入内容并回车时,需将该列名称及输入值整合到SQL查询的WHERE子句中

示例数据表

number    agency        brand   product   ad_product  indication
  1234      salesforce    BMW      sxx       suv          E-class
  5678      apple         iphone   i-14      accessories  B-class

搜索触发SQL示例

场景1:在brand列搜索BMW并回车

生成的SQL语句:

select *,'Primary' "type"  from dev.sales where %brand% = %'BMW'%

场景2:在agency列搜索apple并回车

生成的SQL语句:

select *,'Primary' "type"  from dev.sales where %agency% = %'apple'%

内容的提问来源于stack exchange,提问作者SQLLER

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 08:01:28