Re: Select Problem

2009-12-07 Thread Victor Subervi
On Sun, Dec 6, 2009 at 2:42 PM, Steve Edberg wrote: > At 1:26 PM -0500 12/6/09, Victor Subervi wrote: > >> Hi; >> I have the following: >> >> mysql> select * from categoriesProducts as c inner join >> relationshipProducts >> as r on c.ID = r.Child inner join categoriesProducts as p on r.Parent = >

Re: Select Problem

2009-12-06 Thread Steve Edberg
At 1:26 PM -0500 12/6/09, Victor Subervi wrote: Hi; I have the following: mysql> select * from categoriesProducts as c inner join relationshipProducts as r on c.ID = r.Child inner join categoriesProducts as p on r.Parent = p.ID where p.Category = prodCat2; ERROR 1054 (42S22): Unknown column 'pro

Re: SELECT problem and QUESTION OF SPEED

2005-06-03 Thread Philippe Poelvoorde
Reni Fournier wrote: Thanks for the solution. It looks like it would work, but I don't have MySQL 4.1 (which I believe is required for this to work, since this is SUBSELECT, isn't it?). Assuming I have to use two selects, which would you say is faster, creating a temporary table in MySQL, or

Re: SELECT problem and QUESTION OF SPEED

2005-06-02 Thread René Fournier
Thanks for the solution. It looks like it would work, but I don't have MySQL 4.1 (which I believe is required for this to work, since this is SUBSELECT, isn't it?). Assuming I have to use two selects, which would you say is faster, creating a temporary table in MySQL, or extracting the data b

Re: SELECT problem

2005-06-02 Thread mfatene
Hi René, thsi can be a solution, many others are possible : mysql> select distinct the_date, person_id, cost, name -> from trips,persons -> where person_id=persons.id -> and the_date in(select max(the_date) from trips a -> where a.person_id=person_id -> group by person_id)

Re: SELECT problem

2005-06-02 Thread SGreen
René Fournier <[EMAIL PROTECTED]> wrote on 06/02/2005 02:53:51 PM: > I'm having a really hard time selecting rows from a table in one SELECT > statement. I can do it in two SELECTS, but it seems I should be able to > do it in one. > > TRIPS > > id date person_id cost > --

Re Select problem

2004-06-08 Thread Paul McNeil
Are you spitting out an output of the query string to verify that the data from the form is making it to the query correctly? GOD BLESS AMERICA! To God Be The Glory! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.co

Re: SELECT problem

2003-10-13 Thread Rory McKinley
Hi Andy What you can do is make a "copy" of your genre_titles table through aliasing, this will allow you to only return the results that have both genres and should reduce the need for programmatical sorting - aliasing also makes for less typing :). SELECT a.name, b.titleid FROM titles a, genre_

RE: SELECT problem

2003-07-29 Thread Lin Yu
Hi, Rachel, It seems most people have missed this message. Since you didn't give enough information in your question, in order to answer your question, I need to make up some assumptions, which might or might not be correct :-( Suppose the same favsub could appear in either or both tabl

Re: Select problem

2003-07-29 Thread Eternal Designs, Inc
Dermot Frost wrote: Hi all, I have a table with the following data: ++---+--+ | lpcval | smiles_id | crhash | ++---+--+ | 0.81 | 996 | 0597b6f84e0feaf9596869284e6e0

Re: SELECT problem with mysql 3.23.53-log

2003-06-04 Thread Egor Egorov
"Stefan Schulte" <[EMAIL PROTECTED]> wrote: > i am analyzing a very strange behaviour of mysql-3.23-53-log > on a Suse 8.1 system: > > I have created a table Customer with a column: > customer_id int(11) > > Now i want to select all rows with customer_id=41: > SELECT * from Customer WHERE c

Re: Select Problem

2002-12-05 Thread Arul
Hi Just try this select distinct(a.id) from test a , test b where a.code = 23 and b.code = 45 and a.id = b.id Regards, -Arul - Original Message - From: "Robert Gehrig" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Sent: Wednesday, December 04, 2002 10:52 PM Subject: Select Pro

Re: select problem with "not equal" syntax

2002-10-01 Thread Clayburn W. Juniel, III
On Monday, September 30, 2002, at 08:44 24h, Gebhardt, Karsten wrote: > I have two tables > > CREATE TABLE pid_segment ( > id INT NOT NULL UNIQUE PRIMARY KEY, > msg TEXT) > TYPE=INNODB > > CREATE TABLE hl7incom( > id INT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY REFERENCES > pid_segment > (id

RE: select problem with "not equal" syntax

2002-09-30 Thread Gebhardt, Karsten
Found solution, the right syntax is: SELECT hl7incom.id FROM hl7incom, pid_segment LEFT JOIN pid_segment ON hl7incom.id = pid_segment.id WHERE hl7incom.msg LIKE '%PID%' AND pid_segment.id IS NULL; Cheers for try of help, Karsten Same result, also if I do not define unique index. Just a sug

RE: select problem with "not equal" syntax

2002-09-30 Thread Gebhardt, Karsten
Same result, also if I do not define unique index. Just a suggestion: SELECT hl7incom.id FROM hl7incom, pid_segment WHERE hl7incom.msg LIKE '%PID%' AND not(pid_segment.id = hl7incom.id) GROUP BY hl7incom.id; Otherwise my only other suggestion would involve using the 'NOT IN' logic, but I think

RE: select problem with "not equal" syntax

2002-09-30 Thread Sean Moshenko
luted for your needs. -Original Message- From: Gebhardt, Karsten [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 01, 2002 12:07 AM To: '[EMAIL PROTECTED]' Subject: RE: select problem with "not equal" syntax No way, I've already tried this. > I have two tables

RE: select problem with "not equal" syntax

2002-09-30 Thread Gebhardt, Karsten
No way, I've already tried this. > I have two tables > > CREATE TABLE pid_segment ( > id INT NOT NULL UNIQUE PRIMARY KEY, > msg TEXT) > TYPE=INNODB > > CREATE TABLE hl7incom( > id INT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY REFERENCES pid_segment > (id). > msg TEXT, > time TIMESTAMP NOT NULL

Re: select problem with "not equal" syntax

2002-09-30 Thread John Coder
On Mon, 2002-09-30 at 23:44, Gebhardt, Karsten wrote: > I have two tables > > CREATE TABLE pid_segment ( > id INT NOT NULL UNIQUE PRIMARY KEY, > msg TEXT) > TYPE=INNODB > > CREATE TABLE hl7incom( > id INT NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY REFERENCES pid_segment > (id). > msg TEXT, > tim

RE: select problem

2002-08-09 Thread Mary Stickney
select * from forms_data_recs where fdr_form_id='37' and ( fdr_ff_id ='190' and ( fdr_value like '%keith%' )) OR ( fdr_ff_id = '192' and (fdr_value like '%public%' )) order by fdr_date,fdr_id -Original Message- From: Keith Clay [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 1

Re: Select Problem

2002-07-22 Thread Francisco Reinaldo
Hi, Use LEFT JOIN instead = Bye and Good Luck! --- Mark Colvin <[EMAIL PROTECTED]> wrote: > I want to select from three tables where there may > or may not be a record in > the third table. Table 1 and 2 have a one to one > relationship and table 1 > and 2 both have a one to many relationship w

Re: Select Problem

2002-07-22 Thread Ralf Narozny
Hello! This one should work: SELECT ... FROM table1 t1 LEFT JOIN table2 t2 USING (code) LEFT OUTER JOIN table3 t3 USING(code) WHERE t1.code = t3.code OR t3.code IS NULL ; Mark Colvin wrote: >I want to select from three tables where there may or may not be a record

Re: Select Problem

2002-07-22 Thread Ralf Narozny
Hello! This one should work: SELECT ... FROM table1 t1 LEFT JOIN table2 t2 USING (code) LEFT OUTER JOIN table3 t3 USING(code) WHERE t1.code = t3.code OR t3.code IS NULL ; Mark Colvin wrote: >I want to select from three tables where there may or may not be a record in

Re: Select problem

2001-03-03 Thread Bob Hall
>Hi, > >I having trouble working out how to get a result set similar to the >following where I select from a table with Date & Sales column. > >My specific question is can I have a column that accumulates values, >if so could I have some guidance on how to express this in a select >statement pl

Re: Select problem

2001-03-01 Thread Thalis A. Kalfigopoulos
On Fri, 2 Mar 2001, Nathan Clemons wrote: > > Can't you do something with SUM() to get the results, possibly in > coordination with GROUP BY? > > --Nathan > Not to my knowledge/imagination. What are you going to group by? You want and incremental grouping or better you want a dynamic calcul

Re: Select problem

2001-03-01 Thread Nathan Clemons
Can't you do something with SUM() to get the results, possibly in coordination with GROUP BY? --Nathan On 2001.03.01 23:49:28 -0500 Thalis A. Kalfigopoulos wrote: > Now that I notice more closely the numbers, my answer was obviously wrong > with regard to the 3rd column :o) > > Very interestin

Re: Select problem

2001-03-01 Thread Thalis A. Kalfigopoulos
Now that I notice more closely the numbers, my answer was obviously wrong with regard to the 3rd column :o) Very interesting question...but I doubt there is a SQL way to do that. Looking fwd to what the rest will sugest. cheers, thalis On Fri, 2 Mar 2001, Richard Vibert wrote: > Hi, > At 01

Re: Select problem

2001-03-01 Thread Richard Vibert
Hi, At 01:52 pm 2/03/2001, Thalis A. Kalfigopoulos wrote: >On Fri, 2 Mar 2001, Richard Vibert wrote: > > > Hi, > > > > I having trouble working out how to get a result set similar to the > > following where I select from a table with Date & Sales column. > > > > My specific question is can I have

Re: Select problem

2001-03-01 Thread Thalis A. Kalfigopoulos
On Fri, 2 Mar 2001, Richard Vibert wrote: > Hi, > > I having trouble working out how to get a result set similar to the > following where I select from a table with Date & Sales column. > > My specific question is can I have a column that accumulates values, if so > could I have some guidance

RE: Select Problem

2001-02-15 Thread Julian Strickland
Try rebuilding the indexes. > -Original Message- > From: Alaiddin Tayeh [SMTP:[EMAIL PROTECTED]] > Sent: 15 February 2001 10:34 > To: [EMAIL PROTECTED] > Subject: Select Problem > > Linux , Apache, MySQL > > I have a problem in my MySQL database, this is the senario: > I made an

Re: select-Problem

2001-02-01 Thread Bob Hall
Sir, Joe Celko's 'SQL For Smarties' has two chapters devoted to tree problems. After a quick look in the book, it appears to me that you can use one of his algorithms if you restructure your table and adapt his SQL to the MySQL dialect. See the chapter on Nested Set Models. Bob Hall >Hi, > >

Re: select-Problem

2001-01-29 Thread Oliver Joa
On Sun, 28 Jan 2001, Andrei Cojocaru wrote: > so you want to list all of them starting with the highest level and going > up to the lowest level? yes, or vice-versa. Oliver > > On Mon, 29 Jan 2001, Oliver Joa wrote: > > > Hi, > > > > I have a recursive Problem. I have a Table with columns "

Re: select-Problem

2001-01-28 Thread Andrei Cojocaru
so you want to list all of them starting with the highest level and going up to the lowest level? On Mon, 29 Jan 2001, Oliver Joa wrote: > Hi, > > I have a recursive Problem. I have a Table with columns "id", "name" and > "pid". E.g: > > name1 > name11 > name12 > name121 > name122