如何选择sql索引
我有一个表格TabEmp与字段c_ID (primary key),和c_Emp_ID.
我idx_TabEmp (non-clustered)用字段c_ID (primary key)和字符创建了一个索引c_Emp_ID
我正在使用select语句
select * from index = idx_TabEmp
Run Code Online (Sandbox Code Playgroud)
它抛出一个错误
Incorrect syntax near 'index'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax
Run Code Online (Sandbox Code Playgroud)
我在用
select * from TabEmp (index = idx_TabEmp)
Run Code Online (Sandbox Code Playgroud)
它有效,但我不确定这是否是选择索引的正确方法
你能告诉我查询索引的正确方法吗?
ORACLE: - 表中的名字如下
Binda E
Reven O
Drew J
ANDAL J
WILL Lee
Chad Hardee
Run Code Online (Sandbox Code Playgroud)
我想以下列格式选择名字
Binda
Reven
Drew
ANDAL
WILL
Chad
Run Code Online (Sandbox Code Playgroud)
我使用以下查询,但没有运气
SELECT first_name, SUBSTR(first_name, REGEXP_INSTR('first_name','[^ ]+', 1, 1) ) FROM contact.user_names
Run Code Online (Sandbox Code Playgroud)
请建议.
我有一个名为"shopping_cart_qry.cfm"的页面,它SELECT从各种表中执行一系列查询.它提取数据并填充一个名为的结构shopping.该结构包含大约50个参数,例如:
shopping.company_id
shopping.brand_id
shopping.cost_Price
shopping.expiry_dt
shopping.user_id
shopping.item_name
shopping.item_cost
...
Run Code Online (Sandbox Code Playgroud)
我只需要15出50个参数(的shopping.item_name,shopping.item_cost等等),用于不同的任务.所以我<cfinclude>在名为"item_info.cfm"的新文件中调用"shopping_cart_qry.cfm ".
在我执行<cfdump>该结构的文件中,我看到所有50个参数,包括我需要的15个参数.但是,当我尝试为15个参数分配新名称时,我需要这样:
<cfset itemName = "shopping.item_name">
<cfset itemCost = "shopping.item_Cost">
<cfset itemDt = "shopping.item_Dt">
Run Code Online (Sandbox Code Playgroud)
然后使用<cfdump>看到我能够成功,我看到变量名称(itemName,itemCost等...)但没有值.
<cfdump var="#shopping.item_name#">
<cfdump var="#shopping.item_Cost#">
<cfdump var="#shopping.item_Dt#">
Run Code Online (Sandbox Code Playgroud)
我应该用<script>吗?