zoukankan      html  css  js  c++  java
  • 5:查询两表中的所有字段,满足性别为‘男’的记录(使用语句块)

    5:查询两表中的所有字段,满足性别为‘男’的记录

    1.先创建表t_code_sex

    2.创建表t_employee

    3.编辑数据

    4.执行pl/sql语句块

    ---pl/sql语句块查询满足性别为男的

    declare
    type t_employee_record_type is record(
    v_empid t_employee.emp_id%type,
    v_emp_name t_employee.emp_name%type,
    v_sex_name t_code_sex.name%type);
    v_t_employee_record t_employee_record_type;
    v_sexx varchar2(4);
    begin
    v_sexx:=('&et');
    select emp_id,emp_name,name into v_t_employee_record from t_employee t join t_code_sex e
    on t.sex=e.code and e.name=v_sexx;
    dbms_output.put_line('编号:'||v_t_employee_record.v_empid);
    dbms_output.put_line('姓名:'||v_t_employee_record.v_emp_name);
    dbms_output.put_line('性别:'||v_t_employee_record.v_sex_name);
    end;

    完成!

  • 相关阅读:
    错误机制
    IO文件
    lua与c的交互(运用)
    lua与c的交互(函数专用)
    string库
    元表

    模块与包
    zsh终端下,配置环境变量使用~/.zshrc
    MX150+python3.7+CUDA10.0+Tensorflow-gpu1.13安装记录
  • 原文地址:https://www.cnblogs.com/zhiyanwenlei/p/9643865.html
Copyright © 2011-2022 走看看