选择一个字段以外的所有字段? [英] Selecting all but one field?
问题描述
而不是SELECT * FROM mytable
,我想选择除一个字段之外的所有字段(即,序列化"字段,其中存储了序列化的对象).这是因为我认为丢失该字段将大大加快我的查询速度.但是,我有很多领域,而且是个懒惰的家伙.有话要说...
instead of SELECT * FROM mytable
, i would like to select all fields EXCEPT one (namely, the 'serialized' field, which stores a serialized object). this is because i think that losing that field will speed up my query by a lot. however, i have so many fields and am quite the lazy guy. is there a way to say...
`SELECT ALL_ROWS_EXCEPT(serialized) FROM mytable`
?
谢谢!
推荐答案
不,SQL中没有约定可以获取除一个(或多个指定的)列以外的所有列.
No, there is no convention in SQL to get all but one (or a number of designated) column(s).
明确指出要返回哪些列(最好仅使用表别名(即使仅用于一个表)).
Being explicit about what column(s) are being returned, preferably using a table alias (even if only for one table), is ideal.
这篇关于选择一个字段以外的所有字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!