SQLServer连接查询
- 提问者网友:动次大次蹦擦擦
- 2021-06-01 08:02
- 五星知识达人网友:神的生死簿
- 2021-06-01 09:33
- 1楼网友:掌灯师
- 2021-06-01 10:43
CREATE TABLE [dbo].[bookinfo] ( [code] [int] NOT NULL , [bookname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL , [author] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [bookclass] [int] NULL , [bookpublish] [int] NULL ) ON [PRIMARY] GO
CREATE TABLE [dbo].[classinfo] ( [code] [int] NOT NULL , [classname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL , [classspell] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY] GO
CREATE TABLE [dbo].[publishinfo] ( [code] [int] NOT NULL , [publishname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL , [address] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [telphone] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY] GO
SELECt A.Code,A.BookName,B.ClassName,C.PublishName From bookinfo a,classinfo b,publishinfo c where a.bookclass = b.code and a.bookpublish = c.code