Re: Natural join problem

2009-09-10 Thread John Meyer
Thanks. That worked. Jason Trebilcock wrote: Methinx you need a "GROUP BY" in there. See below. -Original Message- From: John Meyer [mailto:john.l.me...@gmail.com] Sent: Thursday, September 10, 2009 6:48 PM To: mysql@lists.mysql.com Subject: Natural join problem

RE: Natural join problem

2009-09-10 Thread Jason Trebilcock
Methinx you need a "GROUP BY" in there. See below. > -Original Message- > From: John Meyer [mailto:john.l.me...@gmail.com] > Sent: Thursday, September 10, 2009 6:48 PM > To: mysql@lists.mysql.com > Subject: Natural join problem > > Two tables: >

Natural join problem

2009-09-10 Thread John Meyer
Two tables: USERS: USER_ID (PK) . . .etc TWEETS: TWEET_ID (PK) USER_ID (FK) Trying to get the user information and the number of tweets each person has: SELECT USERS.USER_NAME, COUNT(TWEETS.TWEET_ID) AS 'TWEETCOUNT' FROM TWEETS NATURAL JOIN USERS; But it seems to be just rolling

RE: Natural Join Issue: column names are equal but doesn't work anyways

2009-08-25 Thread Gavin Towey
Hi Deviad, NATURAL JOIN uses all column names that are the same between both tables as conditions. select * from rappresentanti NATURAL JOIN clienti; is the same as: select * from rappresentanti r JOIN client c ON r.cognome=c.cognome AND r.nome=c.nome AND r.vita=c.vita AND r.citta=c.citta

Re: Natural Join Issue: column names are equal but doesn't work anyways

2009-08-24 Thread muhammad subair
'405','Williams','Al','519Watson','Grant','MI','49219',402.75,1500,'12'); > insert into clienti > values > ('412','Adams','Sally','16Elm'

Re: Natural Join Issue: column names are equal but doesn't work anyways

2009-08-24 Thread Deviad
stebin.com/f50d77dcf On that database, this query works: select CodCliente, Cognome, Nome from Ordini NATURAL JOIN Clienti where Data='2002-09-05'; whereas this one does not: select * from rappresentanti NATURAL JOIN clienti; I pasted the database in there. Deviad ha scritto: &g

Natural Join Issue: column names are equal but doesn't work anyways

2009-08-24 Thread Deviad
lues ('412','Adams','Sally','16Elm','Lansing','MI','49224',1817.5,2000,'03'); insert into clienti values ('522','Nelson','Mary','108Pine','Ada','MI','49441',98.

Re: question about natural join

2009-01-21 Thread doug
Thank you. On Wed, 21 Jan 2009, c...@l-i-e.com wrote: The natural join will JOIN on *all* the fields whose names match, not just the ones you want it to. In particular, the JOIN is matching up .expires and .expires with "=" You then use WHERE to get only the ones with &quo

Re: question about natural join

2009-01-21 Thread ceo
The natural join will JOIN on *all* the fields whose names match, not just the ones you want it to. In particular, the JOIN is matching up .expires and .expires with "=" You then use WHERE to get only the ones with ">" This is a tautology: There are NO records

question about natural join

2009-01-21 Thread doug
tural join'. I would have thought that the following two queries are equivalent: 1) select t.name,t.expires,d.expires from domains as d natural join temp as t where d.expires>t.expires; 2) select t3.name,t.name,t.expires,d.expires from t3,domains as d,temp as t where t.nam

Re: NATURAL JOIN

2002-07-15 Thread Diana Soares
Warnings: 0 > > mysql> insert into test_2 values (2,'d'),(3,'e'),(4,'f'); > Query OK, 3 rows affected (0.00 sec) > Records: 3 Duplicates: 0 Warnings: 0 > > mysql> select * from test_1 NATURAL JOIN test_2; >

NATURAL JOIN

2002-07-12 Thread Richard Clarke
ery OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select * from test_1 NATURAL JOIN test_2; +--+---+--+--+ | id | value | id | val | +--+---+--+--+ |2 | b |2 | d| |3 | c |3 | e| +--+---