Im trying to find the error in this statement:
CREATE PROCEDURE STP_selectmain
AS
select a.inventoryid, b.firstname, b.lastname, art.title, art.medium,
a.cost, a.inventoryid, a.receivedate, a.dimensions,
a.reference, art.provenance, sum(c.restorationcost),
sum(d.framingcost), sum(e.cost)
from art as a left outer join artist as b on a.artistid =
b.artistid,
a left outer join restoration as c on a.inventoryid =
c.inventoryid,
a left outer join outframing as d on a.inventoryid =
d.inventoryid,
a left outer join basiccosts as e on a.inventoryid =
e.inventoryid
group by a.inventoryid, b.firstname, b.lastname, a.title, a.medium,
a.cost, a.inventoryid, a.receivedate, a.dimensions, a.reference,
a.provenance
order by a.inventoryid desc
GO
eveytime I do a syntax check on it I get this error.
error 1012: the correlation name 'a' has the same exposed name as
table 'a'.
Whats the syntax to fix this?
thanks
-Jim 1 7191
Jim (ji********@motorola.com) writes: select a.inventoryid, b.firstname, b.lastname, art.title, art.medium, a.cost, a.inventoryid, a.receivedate, a.dimensions, a.reference, art.provenance, sum(c.restorationcost), sum(d.framingcost), sum(e.cost) from art as a left outer join artist as b on a.artistid = b.artistid, a left outer join restoration as c on a.inventoryid = c.inventoryid, a left outer join outframing as d on a.inventoryid = d.inventoryid, a left outer join basiccosts as e on a.inventoryid = e.inventoryid
group by a.inventoryid, b.firstname, b.lastname, a.title, a.medium, a.cost, a.inventoryid, a.receivedate, a.dimensions, a.reference, a.provenance order by a.inventoryid desc GO ... error 1012: the correlation name 'a' has the same exposed name as table 'a'.
Whats the syntax to fix this?
You have a mix of old and new FROM syntax, and I would suppose that
you mean:
FROM art AS a
LEFT JOIN artist AS b ON a.artistid = b.artistid
LEFT JOIN restoration AS c ON a.inventoryid = c.inventoryid
LEFT JOIN outframing AS d ON a.inventoryid = d.inventoryid
LEFT JOIN asiccosts AS e on a.inventoryid = e.inventoryid
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Amos |
last post by:
I built the following Sub, in order to create tables automatically.
The button is placed on a mask where there are 3 txt box, two of them
contain the "Bank name" and "Bank a/c". I want to name the...
|
by: crypto_solid via AccessMonster.com |
last post by:
I have been using a SQL database with a VB5 frontend for about 5 years.
Works well. Unfortunately I don't have access to the source code.
I was tasked with implementing a "job entry" application...
|
by: prabhukumarasamy |
last post by:
Now i m working in a existing project. I have to do some updations. In
that project database table contain a table(usergroups) field name as
'Name'. When i am trying to insert a new record in...
|
by: colleen1980 |
last post by:
There is a form where it ask the two dates and then run a query then
report.
Private Sub Command36_Click()
DoCmd.OpenQuery "qryResultsReport"
DoCmd.OpenReport "rpt_TopTen", acPreview, "", ""...
|
by: Orchid |
last post by:
Hello all,
I have different version of reports which used for different months.
For example, I am using report version 1 up to September, but we have
some design changes on the report for October,...
|
by: Rahul B |
last post by:
Hi,
I have very little knowledge about creating Procedures/functions in
DB2.
When i tried to create the test function like
CREATE FUNCTION GET_TEST
(P_TEST_ID INTEGER,
P_SEL_OR_SORT...
|
by: mgstlucia |
last post by:
I know that I saw code on this forum to put the Last Name, First Name in the same field when you start with a table that has 2 separate fields (LASTNAME and FIRSTNAME) but I can't find it.
I...
|
by: bhughes2187 |
last post by:
Hey all,
The access app I am creating, pulls a .dbf file into a table in access. The name of the printer to be printed to is contained in that file/table.
How would I cycle through the list of...
|
by: timleonard |
last post by:
Is it possible and if so, how?
Would like to have code to verify that a file name in a same directory matches with the file name in a table/ field. If it matches then run the rest of the code, if...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |