同一个sql语句在sql Developer里面能查出数据,放到程序里就没有数据了 5
sql语句如下:selecta.*from(selecti.id,(selectc.cat_namefromt_wx_goods_catc,t_wx_goodsgwher...
sql语句如下:
select a.* from
(select i.id,
(select c.cat_name from t_wx_goods_cat c,t_wx_goods g where i.goods_id=g.id and g.cat_id=c.id) catName,
(select g.name from t_wx_goods g where i.goods_id=g.id) goodName,
i.create_date,
(select m.name from t_wx_member m,t_wx_orders o where i.order_id=o.id and o.member_id=m.id) memberName,
i.account,
(select o.code from t_wx_orders o where i.order_id=o.id) code,
(select g.price from t_wx_goods g where i.goods_id=g.id) price,
i.nums,
(select ROUND(o.cost_freight/o.item_num,3) from t_wx_orders o where i.order_id=o.id) cost_freight
from
t_wx_order_items i,t_wx_orders o where i.order_id=o.id and o.status!= 'dead') a
where a.account= 'gh_495e4f484845'
and to_char(a.create_date,'yyyy-MM-dd') >= '2015-07-08'
and to_char(a.create_date,'yyyy-MM-dd') <= '2015-07-08';
这里的时间是同一天,如果时间改成7号和9号在程序里才能把8号的数据查出来,这是什么原因 展开
select a.* from
(select i.id,
(select c.cat_name from t_wx_goods_cat c,t_wx_goods g where i.goods_id=g.id and g.cat_id=c.id) catName,
(select g.name from t_wx_goods g where i.goods_id=g.id) goodName,
i.create_date,
(select m.name from t_wx_member m,t_wx_orders o where i.order_id=o.id and o.member_id=m.id) memberName,
i.account,
(select o.code from t_wx_orders o where i.order_id=o.id) code,
(select g.price from t_wx_goods g where i.goods_id=g.id) price,
i.nums,
(select ROUND(o.cost_freight/o.item_num,3) from t_wx_orders o where i.order_id=o.id) cost_freight
from
t_wx_order_items i,t_wx_orders o where i.order_id=o.id and o.status!= 'dead') a
where a.account= 'gh_495e4f484845'
and to_char(a.create_date,'yyyy-MM-dd') >= '2015-07-08'
and to_char(a.create_date,'yyyy-MM-dd') <= '2015-07-08';
这里的时间是同一天,如果时间改成7号和9号在程序里才能把8号的数据查出来,这是什么原因 展开
2015-07-24
展开全部
1.lock表,点击小锁就可以!
2.修改数据!
3.确定,点击对勾!
4.commit 点击上方的绿色按钮!
因为Developer中看表的数据只能通过查询来看,所以如果楼主想查询完修改的话,可以在sql文后面加上for update关键字,这样就可以对检索出来的数据进行修改了!
2.修改数据!
3.确定,点击对勾!
4.commit 点击上方的绿色按钮!
因为Developer中看表的数据只能通过查询来看,所以如果楼主想查询完修改的话,可以在sql文后面加上for update关键字,这样就可以对检索出来的数据进行修改了!
追问
现在只需要查询,不用修改
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询