473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

adding missing FROM-clause

C G
Dear All,

I have a simple join query

SELECT c1 FROM t1
INNER JOIN
t2 ON t2.c2 = t1.c2 WHERE t3.c3= t2.c3;

Which gives the expected result but I get the message
NOTICE: adding missing FROM-clause entry for table "t3"

How do I get rid of this NOTICE, i.e. how should I construct my select
query.

Many thanks

Colin

__________________________________________________ _______________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!
http://toolbar.msn.co.uk/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
3 4725
cs******@hotmail.com ("C G") writes:
Dear All,

I have a simple join query

SELECT c1 FROM t1
INNER JOIN
t2 ON t2.c2 = t1.c2 WHERE t3.c3= t2.c3;

Which gives the expected result but I get the message
NOTICE: adding missing FROM-clause entry for table "t3"

How do I get rid of this NOTICE, i.e. how should I construct my select
query.


SELECT c1 FROM t1, t2, t3
WHERE t2.c2 = t1.c2 AND t3.c3 = t2.c3;

or

SELECT c1 FROM t1
INNER JOIN t2 ON t2.c2 = t1.c2
INNER JOIN t3 ON T3.c3 = t2.c3;
The above can also be written as

SELECT c1 FROM t1
JOIN t2 USING(c2)
JOIN t3 USING(c3);

or even
SELECT c1 FROM t1
NATURAL JOIN t2
NATURAL JOIN t3;

This last might be problematic if t3 has a column named c1.
Question:

Is there any advantage to specifying USING() rather than ON? I know
that if I do SELECT * from T1 JOIN t2 USING(col) then I only get 1
instance of col in the returned rows, but I'm wondering if there is
any advantage to the planner by specifying either USING() or ON?
--
Remove -42 for email
Nov 23 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 29 October 2004 08:42 am, C G wrote:
Dear All,

I have a simple join query

SELECT c1 FROM t1
INNER JOIN
t2 ON t2.c2 = t1.c2 WHERE t3.c3= t2.c3; ^^^^^
Your join doesn't alias anything as t3
I'd say you get rid of the notice once you replace t3 with t1

Which gives the expected result but I get the message
NOTICE: adding missing FROM-clause entry for table "t3"

How do I get rid of this NOTICE, i.e. how should I construct my select
query.

Many thanks

Colin

__________________________________________________ _______________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!
http://toolbar.msn.co.uk/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


- --
UC

- --
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFBguJDjqGXBvRToM4RArh0AJ46apSm5O/dX4QYJxuC44yyjYcWHQCfZpMu
+UU1SoXolAFx7fEhMUUXp5w=
=GRUr
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3
On Sat, 30 Oct 2004 01:42 am, C G wrote:
Dear All,

I have a simple join query

SELECT c1 FROM t1
INNER JOIN
t2 ON t2.c2 = t1.c2 WHERE t3.c3= t2.c3;
Instead
SELECT c1 FROM t2, t1 INNER JOIN t2 ON t2.c2 = t1.c2 WHERE t3.c3=t2.c3

OR

SELECT c1 FROM t1 INNER JOIN t2 ON t2.c2 = t1.c2 JOIN t3 ON t3.c3 = t2.c3
Which gives the expected result but I get the message
NOTICE: adding missing FROM-clause entry for table "t3"

How do I get rid of this NOTICE, i.e. how should I construct my select
query.

Many thanks

Colin

__________________________________________________ _______________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!
http://toolbar.msn.co.uk/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: pmud | last post by:
In my ASP.Net application I added a required field validator.Before adding this , my application was running fine but after ading this, when i tried to view the .aspx in browser, i got an alert msg...
5
by: surrealtrauma | last post by:
the requirement is : Create a class called Rational (rational.h) for performing arithmetic with fractions. Write a program to test your class. Use Integer variables to represent the private data...
7
by: Mathew Hill | last post by:
I am a beginner to the more technical aspects of Microsoft Access (2000) and was wondering if any one can help. I have 3 buttons on a form which add, delete and search for a record. However, when I...
1
by: RobMea | last post by:
I am trying to find a solution to the following problem. First off I'm new to Access and SQL but have a good back ground in other languages, thus at a new job this has just been dumped on me so...
7
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to...
3
by: Robin Thomas | last post by:
I am fairly new to ASP.NET so I think I am missing something fundamental. Anyway, quite often I am pulling data from a database, but then I need to use that data to produce more data. A simple...
1
by: jim4u | last post by:
Hi gurus, I have an automation add-in created using C# for Excel, in which I am exposing a number of functions. Is there any way I can add help-text the way excel does for other categories like...
5
by: Steven Smith | last post by:
Hi, I'm trying to write a simple program to print invoices for people I do work for. I've got a form with textboxes for descriptions and amounts for items, and some code for printing the...
5
by: Gustaf | last post by:
Here's what happens: I got a Web Service installed locally on my IIS. Then I got a client project, which will call this service. But when I add the Web Reference to the Web Service, and look at the...
8
by: Jason | last post by:
Hello, I am trying to utilitze the AJAX Control toolkit in my asp.net project. I have added a reference to AjaxControlToolkit.dll, and in my page, added these lines of code: ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.