Mysql-could you write an SQL statement to prescribe five prescriptions

Source: Internet
Author: User
Tags what sql
CREATETABLEeng_cf (--- prescription table idVARCHAR (20), -- depart_idVARCHAR (30), departmentVARCHAR (30), bed_noVARCHAR (20 )) ---------------------------------------------- CREATETABLEeng_cf_item (-- the list of prescriptions is the cfidVARCHAR (20), drugVARCHAR (20), d... mysqlsql

Create table eng_cf (--- prescription TABLE
Id VARCHAR (20), -- this id is used
Depart_id VARCHAR (30 ),

Department VARCHAR (30 ),

Bed_no VARCHAR (20 ))

Create table eng_cf_item (-- prescription list, that is, the drug TABLE
Cfid VARCHAR (20 ),
Drug VARCHAR (20 ),
Drug_name VARCHAR (20)

)

It is known that the relationship between the prescription table and the prescription list is one-to-many.
The ID of eng_cf is the same as the cfid of eng_cf_item.
If a prescription uses two CFIDS
What SQL statements are used to prescribe five medicines? Please

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.