【发布时间】:2011-05-17 03:45:02
【问题描述】:
我试图弄清楚如何在我的程序中使用 substr 从表中获取适当的数据。
用户选择“字母”“AA”、“AB”、“AC”、“AD”、“AE”或“全部”
然后我需要比较“panelID”是否具有我假设使用 substr 的“字母”。
panelID 示例:1122AA-0010
$_SESSION['yield'] = "
from (select distinct panelID from DATABASE.TABLE) s, DATABASE.TABLE p
where p.panelID = s.panelID and p.laminationts > '$start_date' and p.laminationts < '$end_date'
group by week(p.laminationts)";
类似的东西
"where substr(p.panelID,4,2) = substr(s.panelID,4,2) and p.laminationts > '$start_date' and p.laminationts < ..."
【问题讨论】: