Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一张 MySQL 照片表,并将它们的尺寸存储在一个 varchar 字段中,即。“1024x768”。有没有办法选择高于或等于给定尺寸的照片,而无需修改表格以分别存储“高度”和“宽度”?
谢谢
SELECT * FROM photos WHERE CAST(SUBSTR(dimensions, 1, LOCATE("x", dimensions)-1) as NUMBER) > @height AND CAST(SUBSTR(dimensions, LOCATE("x", dimensions)+1)) as NUMBER) > @width
*** LOCAL GEMS *** rails (3.2.8) heroku (2.33.0) heroku-api (0.3.6) taps (0.3.24)
尽管直到今天早上已经工作了几个月,heroku db:pul
heroku db:pul