SELECT oNum AS orderNumber,
cBillState AS Province
FROM orders
WHERE oNum IN ('1482775424-189',
‘1482776094-127’,
‘1477536593-991’,
‘1479730802-590’,
‘1479920877-558’,
‘1479096422-217’,
‘1474903184-228’,
‘1477957959-648’,
‘1479275004-578’,
‘1480541117-247’,
‘1477092301-713’,
‘1477312082-716’,
‘1477398916-226’,
‘1477403920-962’,
‘1477413634-609’,
‘1477930535-606’,
‘1477955076-686’,
‘1478135196-101’,
‘1478276590-532’,
‘1478844924-162’,
‘1479359912-609’,
‘1479622476-128’,
‘1479623938-210’,
‘1479906995-505’,
‘1480054418-376’,
‘1480111928-502’,
‘1480125336-888’,
‘1480301567-671’,
‘1480365466-580’,
‘1480894281-609’,
‘1480949109-398’,
‘1479601155-364’,
‘1474307070-332’,
‘1480087806-183’,
‘1482787698-750’,
‘1469897352-353’,
‘1473537581-471’,
‘1473687519-991’,
‘1475351809-812’,
‘1476142232-535’,
‘1478902709-989’,
‘1482417573-419’,
‘1477361844-758’,
‘1480100297-559’,
‘1480994046-164’,
‘1478300763-269’,
‘1480056585-606’,
‘1480074372-121’,
‘1480380512-849’,
‘1480405548-219’,
‘1480945372-748’,
‘1480959346-958’,
‘1480979054-867’,
‘1480980513-214’,
‘1481068320-986’,
‘1481076087-716’,
‘1481305524-603’,
‘1481480028-875’,
‘1481733768-915’,
‘1480087091-948’,
‘1480439466-561’,
‘1482763826-493’,
‘1482905975-834’,
‘1486316457-550’,
‘1480018760-249’,
‘1479928546-617’,
‘1483471273-517’,
‘1484169298-747’,
‘1484190999-915’,
‘1477317500-446’,
‘1477971665-384’,
‘1478569145-467’,
‘1481561486-205’,
‘1481689248-289’,
‘1481689989-374’,
‘1482282006-867’,
‘1482425612-195’,
‘1482676243-627’,
‘1483240226-156’,
‘1483460319-161’,
‘1483465666-256’,
‘1486316720-332’,
‘1478731802-207’,
‘1482277678-164’,
‘1483984301-786’,
‘1483992584-520’,
‘1484020909-291’,
‘1480727936-335’,
‘1486869590-934’,
‘1483982035-667’,
‘1484018163-438’,
‘1484150283-139’,
‘1487613741-802’,
‘1483970473-109’,
‘1483974079-586’,
‘1483975971-790’,
‘1483978751-271’,
‘1483979075-338’,
‘1483983445-537’,
‘1483986171-592’,
‘1483986950-713’,
‘1483988578-641’,
‘1484019809-263’,
‘1484151424-647’,
‘1484171587-685’,
‘1484346681-146’,
‘1484509930-508’,
‘1484527687-400’,
‘1484757246-834’,
‘1486260387-326’,
‘1485277917-300’,
‘1487089945-259’,
‘1487300427-391’,
‘1487698559-786’,
‘1484418776-342’,
‘37-286’,
‘1484262618-505’,
‘1484284655-434’,
‘1484447124-365’,
‘1482762650-132’,
‘1482851934-153’,
‘1482867677-237’,
‘1482956401-918’,
‘1484240287-695’,
‘1484445267-706’,
‘1484561817-854’,
‘1485565268-372’,
‘1487424684-789’,
‘1487467448-150’,
‘1488060650-455’,
‘1488066992-331’,
‘1488149236-354’,
‘1484063475-593’,
‘1484157094-588’,
‘1484859843-314’,
‘1485545522-819’,
‘1486516436-973’,
‘1486964775-771’,
‘1483145436-669’,
‘1483391592-704’,
‘1483502985-747’,
‘1483983727-219’,
‘1484023314-852’,
‘1484081233-200’,
‘1484322973-466’,
‘1484342291-447’,
‘1484406059-583’,
‘1484411015-328’,
‘1484425064-479’,
‘1484452295-582’,
‘1484515700-540’,
‘1484627708-335’,
‘1484632746-862’,
‘1485052037-249’,
‘1485128964-286’,
‘1485190492-888’,
‘1485195733-900’,
‘1485202785-384’,
‘1485216462-233’,
‘1485222790-976’,
‘1485357911-246’,
‘1485459961-895’,
‘1485483263-818’,
‘1485542911-608’,
‘1485568582-415’,
‘1485630460-879’,
‘1481134322-151’,
‘1484703008-980’,
‘1485846056-687’,
‘1484025532-550’,
‘1484066421-733’,
‘1484077460-592’,
‘1484149227-959’,
‘1484162618-303’,
‘1484420681-353’,
‘1484665197-540’,
‘1484755505-933’,
‘1484848858-607’,
‘1485217578-110’,
‘1485316847-965’,
‘1485567177-164’,
‘1485635160-954’,
‘1485713147-552’,
‘1485727727-861’,
‘1485868390-528’,
‘1485978054-311’,
‘1485995204-154’,
‘1486050211-126’,
‘1486232357-429’,
‘1483563899-665’,
‘1484482619-909’,
‘1487036669-169’,
‘1487531819-670’,
‘1489680045-522’,
‘1487607030-673’,
‘1487792756-848’,
‘1489592492-867’,
‘1485976581-271’,
‘1489762699-587’,
‘1489823936-264’,
‘1486680384-909’,
‘1490636775-210’);
-1
A
回答
1
請嘗試以下...
SELECT oNum AS orderNumber,
cBillState AS Province
FROM orders
WHERE oNum IN ('1482775424-189',
'1482776094-127',
'1477536593-991',
'1479730802-590',
'1479920877-558',
'1479096422-217',
'1474903184-228',
'1477957959-648',
'1479275004-578',
'1480541117-247',
'1477092301-713',
'1477312082-716',
'1477398916-226',
'1477403920-962',
'1477413634-609',
'1477930535-606',
'1477955076-686',
'1478135196-101',
'1478276590-532',
'1478844924-162',
'1479359912-609',
'1479622476-128',
'1479623938-210',
'1479906995-505',
'1480054418-376',
'1480111928-502',
'1480125336-888',
'1480301567-671',
'1480365466-580',
'1480894281-609',
'1480949109-398',
'1479601155-364',
'1474307070-332',
'1480087806-183',
'1482787698-750',
'1469897352-353',
'1473537581-471',
'1473687519-991',
'1475351809-812',
'1476142232-535',
'1478902709-989',
'1482417573-419',
'1477361844-758',
'1480100297-559',
'1480994046-164',
'1478300763-269',
'1480056585-606',
'1480074372-121',
'1480380512-849',
'1480405548-219',
'1480945372-748',
'1480959346-958',
'1480979054-867',
'1480980513-214',
'1481068320-986',
'1481076087-716',
'1481305524-603',
'1481480028-875',
'1481733768-915',
'1480087091-948',
'1480439466-561',
'1482763826-493',
'1482905975-834',
'1486316457-550',
'1480018760-249',
'1479928546-617',
'1483471273-517',
'1484169298-747',
'1484190999-915',
'1477317500-446',
'1477971665-384',
'1478569145-467',
'1481561486-205',
'1481689248-289',
'1481689989-374',
'1482282006-867',
'1482425612-195',
'1482676243-627',
'1483240226-156',
'1483460319-161',
'1483465666-256',
'1486316720-332',
'1478731802-207',
'1482277678-164',
'1483984301-786',
'1483992584-520',
'1484020909-291',
'1480727936-335',
'1486869590-934',
'1483982035-667',
'1484018163-438',
'1484150283-139',
'1487613741-802',
'1483970473-109',
'1483974079-586',
'1483975971-790',
'1483978751-271',
'1483979075-338',
'1483983445-537',
'1483986171-592',
'1483986950-713',
'1483988578-641',
'1484019809-263',
'1484151424-647',
'1484171587-685',
'1484346681-146',
'1484509930-508',
'1484527687-400',
'1484757246-834',
'1486260387-326',
'1485277917-300',
'1487089945-259',
'1487300427-391',
'1487698559-786',
'1484418776-342',
'37-286',
'1484262618-505',
'1484284655-434',
'1484447124-365',
'1482762650-132',
'1482851934-153',
'1482867677-237',
'1482956401-918',
'1484240287-695',
'1484445267-706',
'1484561817-854',
'1485565268-372',
'1487424684-789',
'1487467448-150',
'1488060650-455',
'1488066992-331',
'1488149236-354',
'1484063475-593',
'1484157094-588',
'1484859843-314',
'1485545522-819',
'1486516436-973',
'1486964775-771',
'1483145436-669',
'1483391592-704',
'1483502985-747',
'1483983727-219',
'1484023314-852',
'1484081233-200',
'1484322973-466',
'1484342291-447',
'1484406059-583',
'1484411015-328',
'1484425064-479',
'1484452295-582',
'1484515700-540',
'1484627708-335',
'1484632746-862',
'1485052037-249',
'1485128964-286',
'1485190492-888',
'1485195733-900',
'1485202785-384',
'1485216462-233',
'1485222790-976',
'1485357911-246',
'1485459961-895',
'1485483263-818',
'1485542911-608',
'1485568582-415',
'1485630460-879',
'1481134322-151',
'1484703008-980',
'1485846056-687',
'1484025532-550',
'1484066421-733',
'1484077460-592',
'1484149227-959',
'1484162618-303',
'1484420681-353',
'1484665197-540',
'1484755505-933',
'1484848858-607',
'1485217578-110',
'1485316847-965',
'1485567177-164',
'1485635160-954',
'1485713147-552',
'1485727727-861',
'1485868390-528',
'1485978054-311',
'1485995204-154',
'1486050211-126',
'1486232357-429',
'1483563899-665',
'1484482619-909',
'1487036669-169',
'1487531819-670',
'1489680045-522',
'1487607030-673',
'1487792756-848',
'1489592492-867',
'1485976581-271',
'1489762699-587',
'1489823936-264',
'1486680384-909',
'1490636775-210');
解決您的問題,我只是用全局搜索和替換與'
取代的‘
和’
所有出現。
這是編程中的一個常見錯誤。某些版本的SQL和其他語言允許在其他語言中使用「其他」單引號,但是作爲規則,您應該避免這些引號,除非您有特定的理由使用它們,並且知道您可以環境。
如果您有任何問題或意見,請隨時發佈相應評論。
+0
非常感謝!我一直在試圖弄清楚什麼是錯的。 –
+0
不客氣。很高興有幫助。 – toonice
0
在'In'子句中的第一個值之後,您使用的是字符'而不是'。
相關問題
- 1. 1054錯誤,未知列在where子句
- 2. MySQL:錯誤1054(42S22):'where子句'中的未知列
- 3. MySQL的錯誤:在1054未知列「where子句」
- 4. #1054 - 'where子句'中的未知列'max.ACCESS_DATE_TIME'
- 5. 1054 - 'where子句'中的未知列'apa_calda'
- 6. #1054 - 'where子句'中的未知列'XXXX'
- 7. #1054 - 'where子句'中的未知列'a.group_id'
- 8. 'where子句'中的未知列'x'[1054]
- 9. 1054 where子句中的未知列?
- 10. 1054 - 'where子句'中的未知列'cliente'
- 11. 錯誤代碼:1054.'where子句'中的未知列'''
- 12. MySQL的 - 錯誤代碼1054未知cloumn「players.p_name「where子句」
- 13. #1054 - 在未知列'id.especialidades 'where子句'
- 14. MySQL錯誤1054 WHERE子句中
- 15. Python和MySQLdb的錯誤:OperationalError:(1054, 「在 'where子句' 未知列」)
- 16. MYSQL:錯誤1054 - 未知列
- 17. MySQL錯誤1054未知列
- 18. MYSQL錯誤:1054 - 未知列
- 19. 錯誤代碼:1054在未知列「where子句」
- 20. MySQL - 錯誤代碼:1054.'on子句'中的未知列'task_log_wip.task_log_task'
- 21. MySQL錯誤1054:'on子句'中的未知列'hotels.postal_code'
- 22. MySQL錯誤1054在WHERE子句
- 23. 錯誤:'where子句'中的未知列
- 24. Magento:SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'billing_name'
- 25. SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'name'
- 26. SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'0'
- 27. INNER JOIN MySQL錯誤:1054('on子句'中未知列'prodotti.id')
- 28. MySQL的#1054 - 在未知列'foo.column1 'where子句'
- 29. 錯誤:SQLSTATE [42S22]:找不到列:1054 Where子句中的未知列
- 30. CakePHP:SQLSTATE [42S22]:找不到列:1054'where子句'中的'Post'未知列
你的數據庫中是否有這個名稱的列? –
您的報價不正確。 –
這些值實際上是以這種方式存儲在數據庫中嗎?字符串或整數? –