
sql
sustwct
这个作者很懒,什么都没留下…
展开
-
mysql 查询 两个表中 公有字段 按指定约束 输出
memoSELECT o.cname,s.login_id FROM operator_t o,staff_t s where o.login_id=s.login_id and s.org_id='ORG0119';原创 2012-02-06 14:52:12 · 476 阅读 · 0 评论 -
update 更新的值中存在单引号
更新的值为:'1461','1462','1501','1463','1464','1465','1466','1467','1468','1469','1470','1471','1472','1481'update sys_user set localids='''1461'',''1462'',''1501'',''1463'',''1464'',''1465'',''1466'','原创 2012-08-27 15:38:58 · 9595 阅读 · 0 评论 -
upper
select * from tab where tname=upper('ITIL_ROTA_DUTY_VIEW'); select * from tab where tname=upper('itil_rota_duty'); select * from tab where tname=upper('itil_rota_timeperiods'); selec原创 2013-01-17 16:10:46 · 434 阅读 · 0 评论 -
oracle insert 多行 select
insert into sys_user_role(roleid,userid) select roleid,userid from sys_tmp;多行插入insert into sys_user_role(roleid,userid) select roleid,'$B' userid from sys_user_role where userid='$A';原创 2012-09-24 14:53:12 · 1122 阅读 · 0 评论 -
select 指定 列值
two way:roleid列并不在表sys_user中,虚拟roleid列,指定roleid列的值均为aaa,以下两种方式实现。1.username 为表sys_user中存在的列。select userid,replace(username,username,'aaa') as roleid from sys_user ;2.select userid,'aaa'原创 2012-09-26 10:53:36 · 1490 阅读 · 0 评论 -
to_date orders
select * from orders where order_date原创 2012-09-28 11:14:21 · 310 阅读 · 0 评论 -
以时间为条件 select update
SELECT * FROM service_request_t where create_time >='2012-02-02 00:00:00' and siteid='8'and creator='STAFF00707';update service_request_t set owner_group='group20120314000089',siteid='22' where原创 2012-04-10 16:54:07 · 462 阅读 · 0 评论 -
mysql update
for exampleSELECT * FROM ci_info_t where station_id='STA0623';update ci_info_t set station_id='STA0629' where station_id='STA0623';update station_t set station_id=replace(station_id,原创 2012-03-21 11:53:01 · 331 阅读 · 0 评论 -
mysql select
SELECT * FROM staff_t where person_id='P2012023031' or person_id='P2012023034';原创 2012-03-27 17:15:03 · 256 阅读 · 0 评论 -
myql delete
delete from person_t where id='P2012023031';原创 2012-03-27 17:15:48 · 315 阅读 · 0 评论 -
oracle列变成行逗号分隔
用系统中的wm_concat函数实现:select wm_concat(table_name) from user_tables;原创 2013-08-20 13:12:12 · 1200 阅读 · 0 评论