SQL索引查詢的用法有以下幾種:
SELECT * FROM table_name WHERE column_name = 'value';
SELECT * FROM table_name WHERE column_name BETWEEN 'value1' AND 'value2';
SELECT * FROM table_name ORDER BY column_name;
SELECT * FROM table1 INNER JOIN table2 ON table1.column_name = table2.column_name;
SELECT * FROM table_name WHERE column_name = 'value' LIMIT 1;
SELECT column_name FROM table_name WHERE column2_name = 'value';
需要注意的是,索引并不是萬能的,過多或不合理的索引可能會導致性能下降,因此在使用索引時需要根據實際情況進行評估和優化。