这是我的表
如何编写查询,我想从ID = 2开始选择行数(或者可以是我输入的任何其他数字),但仅限于IDveterinar = 5或我输入的其他数字
像SELECT COUNT(*) AS count FROM mytable...
答案 0 :(得分:2)
SELECT
COUNT(*) AS count FROM mytable
WHERE
ID >= 2
AND IDveterinar = 5
答案 1 :(得分:2)
SELECT COUNT(*) AS count FROM mytable WHERE id>=2 AND IDveterinar=5;
答案 2 :(得分:2)
如果要选择从ID 2(包括)开始的行数,则这是查询:
SELECT COUNT(*) AS count
FROM myTable
WHERE ID >= 2 AND IDveterinar = 5;
如果要选择从ID 2(不包括)开始的行数,则这是查询:
SELECT COUNT(*) AS count
FROM myTable
WHERE ID > 2 AND IDveterinar = 5;