我读了一些文章,但真的不明白该怎么select 1 from做?有人说“您应该使用select 1而不是select *”。这是一个示例表:
cust_id     cust_name       cust_address
1000000001  Village Toys    Mapl
1000000002  Kids Place      South
1000000003  Fun4All         Sunny
1000000004  Fun4All         Riverside
1000000005  The Toy Store   53rd
当我写select 1 from customer_table这条语句做什么时,结果将是什么?
select 1不要select *使用EXISTS条款来建议。优化器在很久以前就得到了改进。它绝不能替代“从此结果集中获取所有列”。