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';
需要注意的是,索引并不是万能的,过多或不合理的索引可能会导致性能下降,因此在使用索引时需要根据实际情况进行评估和优化。