尝试在 SQL Server 中执行时,我不断收到错误消息:
消息 156,级别 15,状态 1,过程 sql_chp4a_premiere_assign,第 5 行
关键字“SELECT”附近的语法不正确。
我认为它指的是第一个SELECT
. 我对 SQL 还不是很熟悉(以及由于可怕的风暴和春假而有一段时间没有上课)所以这可能是我忽略的一些愚蠢的事情。
USE [school username that gives out my name)
CREATE PROCEDURE sql_chp4a_premiere_assign
SELECT PART_NUM,DESCRIPTION,PRICE
FROM PART;
SELECT *
FROM ORDERS
SELECT CUSTOMER_NAME
FROM customer
WHERE CREDIT_LIMIT>=10000;
SELECT ORDER_NUM
FROM ORDERS
WHERE CUSTOMER_NUM = '608'
AND ORDER_DATE = '2010-10-23';
SELECT CUSTOMER_NUM,CUSTOMER_NAME
FROM CUSTOMER
WHERE REP_NUM=35 OR REP_NUM=65;
SELECT PART_NUM,DESCRIPTION
FROM PART WHERE CLASS!='AP';
SELECT PART_NUM,DESCRIPTION,ON_HAND
FROM PART
WHERE ON_HAND BETWEEN 10 AND 25;
SELECT PART_NUM,DESCRIPTION,ON_HAND
FROM PART
WHERE ON_HAND>=10 AND ON_HAND<=25;
SELECT PART_NUM,DESCRIPTION,(ON_HAND * PRICE)
AS "ON_HAND_VALUE"
FROM PART WHERE CLASS='SG';
SELECT PART_NUM,DESCRIPTION,(ON_HAND * PRICE)
AS "ON_HAND_VALUE"
FROM PART
WHERE (ON_HAND * PRICE)>7500;
SELECT PART_NUM,DESCRIPTION,(ON_HAND * PRICE)
AS "ON_HAND_VALUE"
FROM PART WHERE (ON_HAND * PRICE)>7500;
谢谢,我真的很感激任何帮助。