学习笔记6.15

本文详细介绍了SQL中的不同类型的联结操作,包括内联结、外联结等,并通过具体示例展示了如何使用这些联结来从多个表中检索数据。
--给表名起别名
select cust_name,cust_contact
from customers  c,orders o,orderitems  oi
where c.cust_id=o.cust_id
and oi.order_num=o.order_num
and prod_id='RGAN01';
--oracle无as关键字

--自然联结
select c.*,o.order_num,o.order_date,oi.prod_id,oi.quantity,oi.item_price
from customers c,orders o,orderitems oi
where c.cust_id=o.cust_id
and oi.order_num=o.order_num
and prod_id='RGAN01';

--内联结
select customers.cust_id,orders.order_num
from customers inner join orders
on customers.cust_id=orders.cust_id;


--外联结
select customers.cust_id,orders.order_num
from customers left outer join orders
on customers.cust_id=orders.cust_id;

select customers.cust_id,orders .order_num
from orders full outer join customers
on Orders.cust_id=customers.cust_id;

/*left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录

right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录

inner join(等值连接) 只返回两个表中联结字段相等的行*/

select customers.cust_id,orders .order_num
from orders right outer join customers
on Orders.cust_id=customers.cust_id;

select customers.cust_id,count(orders.order_num) num_ord
from customers inner join orders
on customers.cust_id=orders.cust_id
group by customers.cust_id;

select customers.cust_id,
count(orders.order_num) num_ord
from customers left outer join orders
on customers.cust_id=orders.cust_id
group by customers.cust_id;

基于粒子群优化算法的配电网光伏储能双层优化配置模型[IEEE33节点](选址定容)(Matlab代码实现)内容概要:本文介绍了基于粒子群优化算法(PSO)的配电网光伏储能双层优化配置模型,针对IEEE33节点系统进行光伏与储能系统的选址定容优化。该模型采用双层优化结构,上层以投资成本、运行成本和网络损耗最小为目标,优化光伏和储能的配置位置与容量;下层通过潮流计算验证系统约束,确保电压、容量等满足运行要求。通过Matlab编程实现算法仿真,利用粒子群算法的全局寻优能力求解复杂非线性优化问题,提升配电网对可再生能源的接纳能力,同时降低系统综合成本。文中还提供了完整的代码实现方案,便于复现与进一步研究。; 适合人群:具备电力系统基础知识和Matlab编程能力的研究生、科研人员及从事新能源规划的工程技术人员;熟悉优化算法与配电网运行分析的专业人士。; 使用场景及目标:①用于分布式光伏与储能系统的规划配置研究,支持科研项目与实际工程设计;②掌握双层优化建模方法与粒子群算法在电力系统中的应用;③实现IEEE33节点系统的仿真验证,提升对配电网优化调度的理解与实践能力。; 阅读建议:建议结合Matlab代码逐步理解模型构建过程,重点关注目标函数设计、约束条件处理及上下层交互逻辑,同时可扩展至其他智能算法对比实验,深化对优化配置问题的认知。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值