插入时排序是否重要? [英] Does ordering matter when doing an insert?

查看:69
本文介绍了插入时排序是否重要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此查询:

"INSERT INTO credentials (h_token, h_file, h_pass, email, name, picture, privacy) VALUES (?, ?, ?, ?, ?, ?, ?)",

根据列名的顺序,表结构是否重要.

does the table structure matter in terms of the ordering of the column names.

h_tokenh_file等可以按任何顺序出现吗?按顺序,我指的是phpmyadmin显示的内容,我假设也有一些内部顺序.

Can h_token, h_file, etc. appear in any order? By order I'm referring to what phpmyadmin displays, I assume there is some internal order as well.

我有90%的能力,但是我想确保.

I'm 90% they can, but I wanted to make sure.

推荐答案

如果您指定列名,则排序很重要(您必须按照表的结构顺序插入) .如果您正在指定列名,则顺序无关紧要.

If you're not specifying column names, then ordering matters (you must INSERT in the same order that the table is structured). If you are specifying the column names, the order doesn't matter.

例如:

INSERT INTO TABLE_NAME VALUES ('','','')
// Here the values needs to be in order of columns present in your table.

INSERT INTO TABLE_NAME (ID, NAME, EMAIL) VALUES ('','','')`
// Here, ordering can be changed as per requirement.

这篇关于插入时排序是否重要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆