-1
我在SQLite的一表「produit」我想要得到的分而不是由subtring「規範」表的行,這是我的查詢:查詢MIN()SUBSTR()SQLite中
select MIN (substr(Code_produit,1,charindex('-',Code,1))+1)
from produit
where (substr(Code,1,charindex('-',Code_produit,1)) + 1)
not in (select (substr(Code,1,charindex('-',Code_produit,1))) from produit)
例如:我的行數據「代碼」是這樣的「PRD-1」
我不知道你*的意思,但我想查詢不會在以下數據existe最小,在本例就必須2 *,請提供表格模式,一些示例數據和預期的結果。 – 2014-03-04 22:55:03
我有以下數據: 列代碼 PRD-13 PRDF -4- ADQ-1 ASFS-77 AGXX-9 AMXX-14 AXX-17 我希望查詢的最小值的第二方(後 - )不存在以下數據,在這個例子中它必須是2 我做一個但它不起作用 選擇MIN(substr(Code,charindex('_',Code) +1)+1)from produit where(substr(Code,charindex('_',Code)+1)+ 1)not in(select(substr(Code,charindex('_',Code)+1))from produit) – nasrsoft
來自w這2個來自哪裏? – 2014-03-04 23:15:00