`
张玉龙
  • 浏览: 721937 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

查询多条 id SELECT * FROM table where id in(1,2,3)

 
阅读更多

SELECT * FROM table where id in(1,2,3)



分享到:
评论

相关推荐

    T-SQL高级查询

    select * from student where id not in (1, 2); --is null 是空 select * from student where age is null; --is not null 不为空 select * from student where age is not null; --order by 排序 select * ...

    探讨select in 在postgresql的效率问题

    MySQL 查询 select * from table where id in (几百或几千个 id) 如何提高效率?修改 电商网站,一个商品属性表,几十万条记录,80M,索引只有主键id,做这样的查询如何提高效率? select * from table where id ...

    经典全面的SQL语句大全

    select a,b,c from a where a IN (select d from b ) 或者: select a,b,c from a where a IN (1,2,3)  5、说明:显示文章、提交人和最后回复时间 select a.title,a.username,b.adddate from table a,(select max...

    数据库操作语句大全(sql)

    select a,b,c from a where a IN (select d from b ) 或者: select a,b,c from a where a IN (1,2,3) 5、说明:显示文章、提交人和最后回复时间 select a.title,a.username,b.adddate from table a,(select max...

    mysql数据库的基本操作语法

    修改多条或指定条件的数据,需要用where条件来完成。 修改所有数据 update temp set name = ‘jack2’; 所有的数据的name会被修改,如果修改多列用“,”分开 update temp set name = ‘jack’, age = 22; 修改指定...

    经典SQL语句大全

    select a,b,c from a where a IN (select d from b ) 或者: select a,b,c from a where a IN (1,2,3) 5、说明:显示文章、提交人和最后回复时间 select a.title,a.username,b.adddate from table a,(select max...

    sql经典语句一部分

    select a,b,c from a where a IN (select d from b ) 或者: select a,b,c from a where a IN (1,2,3) 5、说明:显示文章、提交人和最后回复时间 select a.title,a.username,b.adddate from table a,(select max...

    MySql基本查询、连接查询、子查询、正则表达查询讲解

    select * from STUDENT where STU_ID<2005 OR STU_ID>2015; and ( && ) 逻辑与 AND关键字可以用来联合多个条件进行查询。使用AND关键字时,只有同时满足所有查询条件的记录会被查询出来。如果不满足这些查询条件...

    Oracle事例

    delete from a where no in (select no from b); 14、查询从多少行到多少行的记录(可以用在web开发中的分页显示) select * from ( select rownum row_id,b.* from (select a.* from sys_oper a) b ) where row_...

    [php]mysql数据库操作——DB类

    ("SELECT * INTO `{$tb1}` FROM `{$tb2}` {$Condition}");} /****************************************************************** -- 函数名:Get($Table,$Fileds,$Condition,$Rows) -- 作 用:查询数据 -- ...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

    varchar2 1~4000字节 可变长度字符串,与CHAR类型相比,使用VARCHAR2可以节省磁盘空间,但查询效率没有char类型高 数值类型 Number(m,n) m(1~38) n(-84~127) 可以存储正数、负数、零、定点数和精度为38位的浮点数...

    mysql数据库操作

    1、关联查询 select students.name,class.name from class inner join students on class.id = students.classid; 2、left join 会将A中有的填充到左边,没有用null填充 3,rightjoin 会将b中有填充到右边,没有用...

    精髓Oralcle讲课笔记

    2、select 2*3 from dual; --计算一个比较纯的数据用dual表 3、select sysdate from dual; --查看当前的系统时间 4、select ename, sal*12 anuual_sal from emp; --给搜索字段更改名称(双引号 keepFormat 别名...

    社交系统中用户好友关系数据库设计.pdf

    查询好友列表的SQL如下: select friend_id as friends ,user_group as my_group from tb_friends where user_id = 1 UNION ALL select user_id as friends , friend_group as my_group from friend_id = 1 1 2 3 4 ...

    mysql实现随机查询经验谈

    方法二:SELECT * FROM `table` WHERE id >= (SELECT floor(RAND() * (SELECT MAX(id) FROM `table`))) ORDER BY id LIMIT 1;  解释:SELECT MAX(id) FROM `table` 这句话查询出最大的id值  

    SQL语法大全

    sql="select * from 数据表 where 字段名 in (\'值1\',\'值2\',\'值3\')" sql="select * from 数据表 where 字段名 between 值1 and 值2" (2) 更新数据记录: sql="update 数据表 set 字段名=字段值 where 条件...

    SQL 基础--SELECT 查询

    SQL> SELECT EMPNO,ENAME,SAL,COMM * 12 FROM SCOTT.EMP WHERE COMM IS NOT NULL EMPNO ENAME SAL COMM*12 ---------- ---------- ---------- ---------- 7499 ALLEN 1600 3600 7521 WARD 1250 6000 7654 ...

    orcale常用命令

    SQL>select column_name,comments from dict_columns where table_name='USER_INDEXES'; 依此类推,就可以轻松知道数据字典的详细名称和解释,不用查看ORACLE的其它文档资料了。 下面按类别列出一些ORACLE用户...

    oracle数据库经典题目

    SELECT * FROM Type WHERE T_ID=100 AND T_NAME=’FRUIT’ C. UPDATE SET T_ID=100 FROM Types WHERE T_Name=’FRUIT’ D. DELET * FROM Types WHERE T_ID=100 AND T_Name=’FRUIT’ 13. 用_____语句修改表的一行或...

    MYSQL常用命令大全

    命令: select <字段1,字段2,...> from 表名 > where 表达式 > 例如:查看表 MyClass 中所有数据 mysql> select * from MyClass; 2)、查询前几行数据 例如:查看表 MyClass 中前2行数据 mysql> select * from ...

Global site tag (gtag.js) - Google Analytics