Re: Stumped again by joins

2006-04-25 Thread Peter Brawley
Chris, >select count(distinct uid) as c >from aptg_guides_restricted as r, aptg_guides as g .. See the extensive notes on comma and SQL2003 joins at http://dev.mysql.com/doc/refman/5.1/en/join.html. Lose the comma join, make it a SQL2003 (explicit inner) join. PB - At 15:56 +0200 25

Re: Stumped again by joins

2006-04-25 Thread Chris Sansom
At 11:10 -0500 25/4/06, gerald_clark wrote: Yes. 3.23 was not correct in the order of precedence. This has been answered many times here. Sorry - I haven't been on the list all that long. You need to change your comma join to an inner join. Lovely! That's it - many thanks. At 17:15 +0100 2

Re: Stumped again by joins

2006-04-25 Thread Philippe Poelvoorde
2006/4/25, Chris Sansom <[EMAIL PROTECTED]>: > At 15:56 +0200 25/4/06, Barry wrote: > >And you don't see any misdone queries when you echo them, right? > >Hope you checked that. > > Hi Barry > > I was wrong about its being a PHP issue: it's > definitely a MySQL error. I realised I hadn't > handled

Re: Stumped again by joins

2006-04-25 Thread gerald_clark
Chris Sansom wrote: At 15:56 +0200 25/4/06, Barry wrote: And you don't see any misdone queries when you echo them, right? Hope you checked that. Hi Barry I was wrong about its being a PHP issue: it's definitely a MySQL error. I realised I hadn't handled the error in such a way that I cou

Re: Stumped again by joins

2006-04-25 Thread Chris Sansom
At 15:56 +0200 25/4/06, Barry wrote: And you don't see any misdone queries when you echo them, right? Hope you checked that. Hi Barry I was wrong about its being a PHP issue: it's definitely a MySQL error. I realised I hadn't handled the error in such a way that I could see what it was, but

Re: Stumped again by joins

2006-04-25 Thread Chris Sansom
At 15:56 +0200 25/4/06, Barry wrote: Updating is always such a bad idea ;P Do you know: never touch a running system? ^_^ Hmmm... And you don't see any misdone queries when you echo them, right? Hope you checked that. Yes, they look just fine - in any case they're unchanged from when it wa

Re: Stumped again by joins

2006-04-25 Thread Barry
Chris Sansom schrieb: As a relative newbie, and an almost total newbie to the use of left joins, I'm aware that there's some difference in the way joins work between MySQL 3.x and 5.x, but in my ignorance I can't figure out what the heck it is from reading the 'upgrading' pages on dev.mysql.com

RE: Stumped on a query

2004-01-20 Thread Ted . A . Gifford
Asplund [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 1:26 PM To: Chris Boget Cc: [EMAIL PROTECTED]; MySQL Subject: Re: Stumped on a query On Tue, 20 Jan 2004, Chris Boget wrote: > > > The data I'm working with looks like this: > > > table1.columnA = '1;3;4

Re: Stumped on a query

2004-01-20 Thread Tobias Asplund
On Tue, 20 Jan 2004, Chris Boget wrote: > > > The data I'm working with looks like this: > > > table1.columnA = '1;3;4;6;8;9;12;13;14;15'; > > > table2.columnA = '3'; > > > table2.columnB = 'this'; > > > I need to write a query that will do something along these lines: > > > SELECT * FROM table1,

Re: Stumped on a query

2004-01-20 Thread Fred van Engen
On Tue, Jan 20, 2004 at 03:02:45PM -0600, Chris Boget wrote: > > > The data I'm working with looks like this: > > > table1.columnA = '1;3;4;6;8;9;12;13;14;15'; > > > table2.columnA = '3'; > > > table2.columnB = 'this'; > > > I need to write a query that will do something along these lines: > > > SE

Re: Stumped on a query

2004-01-20 Thread Chris Boget
> > The data I'm working with looks like this: > > table1.columnA = '1;3;4;6;8;9;12;13;14;15'; > > table2.columnA = '3'; > > table2.columnB = 'this'; > > I need to write a query that will do something along these lines: > > SELECT * FROM table1, table2 WHERE > > table2.columnB = 'this' > > AND >

Re: Stumped on a query

2004-01-20 Thread Tobias Asplund
On Tue, 20 Jan 2004, Chris Boget wrote: > The data I'm working with looks like this: > > table1.columnA = '1;3;4;6;8;9;12;13;14;15'; > > table2.columnA = '3'; > table2.columnB = 'this'; > > I need to write a query that will do something along these lines: > > SELECT * FROM table1, table2 WHERE >

RE: STUMPED: How Can I Pull Related Info Using Subqueries/Joins?

2003-08-14 Thread Andy Eastham
Patrick, You need "outer joins" to do this. Try searching for "outer join sql tutorial" on Google. Hope this helps, Andy > -Original Message- > From: Patrick Crowley [mailto:[EMAIL PROTECTED] > Sent: 07 August 2003 16:51 > To: [EMAIL PROTECTED] > Subject: STUMPED: How Can I Pull Relate

Re: STUMPED: How Can I Pull Related Info Using Subqueries/Joins?

2003-08-14 Thread Patrick Crowley
> Sounds as if your table is not normalized for that kind of query. If > there are multiple directors id'd by multiple movies you could left > outer join the movie.id with the director.id > > Make sense? Actually, it's normalized beyond that. Sometimes, movies have more than one director, so th

RE: STUMPED: How Can I Pull Related Info Using Subqueries/Joins?

2003-08-14 Thread Jay Blanchard
[snip] Thanks, Jay and Andy! OUTER JOINS work great for part of my query. But how would you modify this query to support multiple directors? (That's why I've got a movie_director table.) Movie Name | Director A, Director B, etc. | 35 comments Best, Patrick > SELECT foo > FROM movie LEFT OU

Re: STUMPED: How Can I Pull Related Info Using Subqueries/Joins?

2003-08-14 Thread Patrick Crowley
Thanks, Jay and Andy! OUTER JOINS work great for part of my query. But how would you modify this query to support multiple directors? (That's why I've got a movie_director table.) Movie Name | Director A, Director B, etc. | 35 comments Best, Patrick > SELECT foo > FROM movie LEFT OUTER JOI

RE: STUMPED: How Can I Pull Related Info Using Subqueries/Joins?

2003-08-14 Thread Kevin Fries
> Sometimes, movies have more than one director, so the > association between movies and directors needs to be in its > own table, instead of the movies table. (Otherwise, you're > limited to some fixed number of directors per > film.) > > Directors may not be the best example. Think about prod

Re: STUMPED: How Can I Pull Related Info Using Subqueries/Joins?

2003-08-14 Thread Patrick Crowley
The comma after Gerlad R was a typo. As for the 500 actors issue, I'm merely using the movie db as an example. People always post the strangest db's to this list ("I have one table for monkeys and one for fishes who speak Urdu, and I need..."), so I thought I'd spare everyone the particulars of mi

RE: STUMPED: How Can I Pull Related Info Using Subqueries/Joins?

2003-08-12 Thread Jay Blanchard
[snip] But here's where I'm stuck: for each film, I need to pull the movie info in 'movies', plus any related data from other tables, like this: The Lord of the Rings | Peter Jackson | 3 comments Episode II| George Lucas | 0 comments Indiana Jones | Steven

RE: Stumped on error messages -OOPS

2003-06-23 Thread Jennifer Goodie
> I am changing a database and changing the user and password of an > existing > database. when I enter the line. > > mysql> insert into user (host, user, password) values ('localhost', > 'newuser', password ('newpswrd')); > > the error 1062: Duplicate entry 'localhost-newuser' for key 1 > mysql>

Re: Stumped

2002-04-26 Thread Gelu
Hi Ian, 1.What version of Linux use ? 2.Type "top" and you can see at least 4 mysqld processes.Is nothing bad.And for every new connected client apear a new mysqld process. Regards, Gelu _ G.NET SOFTWARE COMPANY Permanent e-mail address : [EMAIL

Re: Stumped

2002-04-26 Thread Dicky Wahyu Purnomo
On Fri, 26 Apr 2002 18:27:24 +1000 "Ian Phillips" <[EMAIL PROTECTED]> wrote: > > Thanks to Gelu for his patience: unfortunately his suggestion of > Gelu> Go to /etc/init.d and type : ./mysql(d) restart > didn't work for me, as I do not have init.d in /etc - I have searched for > ti, but not ther

Re: Stumped

2001-02-24 Thread Cory Whitesell
Many thanks. Problem is cured - Original Message - From: "Thalis A. Kalfigopoulos" <[EMAIL PROTECTED]> To: "Cory Whitesell" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, February 24, 2001 4:26 PM Subject: Re: Stumped > > Thi

Re: Stumped

2001-02-24 Thread Thalis A. Kalfigopoulos
> This should be very simple, but for some reason, my query does not return the >desired results > I have the following two tables: > > CREATE TABLE Rank ( > Rank CHAR(40) NOT NULL PRIMARY KEY, > ReportsTo CHAR(40) NULL > ); > > CREATE TABLE ROSTER ( > EntryNumber INTEGER NOT NULL AUTO_