Re: Joining tables from different Instances

2011-05-25 Thread Rik Wasmus
On 2011-05-25 13:50:32 Ramesh wrote: > I have a different schemas in different instances. > > I would like to join the tables in different instances for the required > result. > > Is it possible? > > Example > = > > Server I - table_1a, table_2b > Server II - table_2a,table_2b. > > I want

Re: Joining tables from different Instances

2011-05-25 Thread Reindl Harald
Am 25.05.2011 13:50, schrieb Ramesh: > Hi > > I have a different schemas in different instances. > > I would like to join the tables in different instances for the required > result. > > Is it possible? > > Example > = > > Server I - table_1a, table_2b > Server II - table_2a,table_2b. >

Joining tables from different Instances

2011-05-25 Thread Ramesh
Hi I have a different schemas in different instances. I would like to join the tables in different instances for the required result. Is it possible? Example = Server I - table_1a, table_2b Server II - table_2a,table_2b. I want to join the table_1a with table_2b. Is is possible?

Re: SUM() acting funny when joining

2010-01-14 Thread Baron Schwartz
John, What's happening is that the tables do not have a one-to-one relationship, so the JOIN duplicates rows from Orders to match the rows in Lineitems. You need to ensure the aggregation is consistent across the two datasets. Try this: SELECT Sum(a.ordertotal) as total, line_item

SUM() acting funny when joining

2010-01-14 Thread John Nichel
Hi, The function is probably behaving as intended, but its confusing the hell out of me. ;) Anyway, say I have two tables; orders and lineitems Orders has two columns: orderid(primary key) and ordertotal Lineitems has two columns: orderid and itemid For every orderid in the orders table, the

Re: Trouble joining 3 tables

2009-11-03 Thread Brian Dunning
Darn, it's not working after all. SELECT people.*, COUNT ( DISTINCT cars.car_id ) AS car_count, COUNT ( DISTINCT pets.pet_id ) AS pet_count, SUM ( IF ( pets.date_bought > NOW() - INTERVAL 7 DAY, 1, 0 ) ) AS new_pet_count WHERE...etc car_count and pet_count are calculating correctly, but new_p

Re: Trouble joining 3 tables

2009-11-02 Thread Johnny Withers
Yes, I don't see why that wouldn't work... On Mon, Nov 2, 2009 at 11:09 AM, Brian Dunning wrote: > Johnny - Your solution might actually help me solve my next step, which is > to also return a count of pets bought only within the last 7 days. Something > like this: > > > >> SELECT people.*, >>

Re: Trouble joining 3 tables

2009-11-02 Thread Brian Dunning
Johnny - Your solution might actually help me solve my next step, which is to also return a count of pets bought only within the last 7 days. Something like this: SELECT people.*, SUM(IF(cars.id IS NULL,0,1)) AS car_count, SUM(IF(pets.id IS NULL,0,1)) AS pet_count, SUM ( IF ( pets.d

Re: Trouble joining 3 tables

2009-11-02 Thread Brian Dunning
Thanks, this solved it! On Nov 2, 2009, at 12:37 AM, Michael Dykman wrote: I suspect 'distinct' might help you out here. SELECT people.*, count(distinct cars.car_id) as car_count, count(distinct pets.pet_id) as pet_count -- MySQL General Mailing List For list archives: htt

Re: Trouble joining 3 tables

2009-11-02 Thread Johnny Withers
You are asking for all records form all tables. So, If 1 person has 1 car and 1 pet, there will be 2 records returned for that 1 person. You'll need to use SUM() instead of COUNT(): SELECT people.*, SUM(IF(cars.id IS NULL,0,1)) AS car_count, SUM(IF(pets.id IS NULL,0,1)) AS pet_count, Ma

Trouble joining 3 tables

2009-11-01 Thread Brian Dunning
Hi all - I have a table of PEOPLE, and a table of CARS owned by various people, and a table of PETS owned by various people. Each person may have 0 or more pets, and each person may have 0 or more cars. I'm trying to return a list of all the people, showing how many pets each person has,

Re: Joining memory tables is very very slow!

2009-04-01 Thread Virgilio Quilario
> I'm using MySQL 5.1.30 and have several memory tables with indexes on the > appropriate columns. When I try and join 2 particular memory tables together > to get 5k rows, it takes 90 seconds. > This is incredibly slow considering table1 has 11k rows and table2 has 5k > rows. A table join like thi

Re: Joining memory tables is very very slow!

2009-03-31 Thread Walter Heck - OlinData.com
Memory tables use hash indexes by default instead of b-tree. Try changing the index, that should help significantly. regards, Walter On Tue, Mar 31, 2009 at 6:47 PM, mos wrote: > I'm using MySQL 5.1.30 and have several memory tables with indexes on the > appropriate columns. When I try and join

Joining memory tables is very very slow!

2009-03-31 Thread mos
I'm using MySQL 5.1.30 and have several memory tables with indexes on the appropriate columns. When I try and join 2 particular memory tables together to get 5k rows, it takes 90 seconds. This is incredibly slow considering table1 has 11k rows and table2 has 5k rows. A table join like this shoul

Re: Joining subqueries

2008-10-23 Thread Moon's Father
mrc_titles is a temp table? On Wed, Oct 15, 2008 at 11:59 PM, Jerry Schwartz <[EMAIL PROTECTED] > wrote: > I tried to make a query that joins to subqueries: > > > > SELECT discontinued.b > > FROM > > (SELECT mrc_titles.title AS a > > FROM mrc_titles JOIN prod ON mrc_titles.tit

Joining subqueries

2008-10-15 Thread Jerry Schwartz
I tried to make a query that joins to subqueries: SELECT discontinued.b FROM (SELECT mrc_titles.title AS a FROM mrc_titles JOIN prod ON mrc_titles.title = prod.prod_title JOIN pub ON prod.pub_id = pub.pub_id WHERE pub.pub_code = "MRC"

Re: Joining a table to itself

2008-07-08 Thread Phil
I think you have just got your table names confused. Try this one SELECT cats.CatId, cats.cat As cat, cats1.catid AS catid1, cats1.cat As cat1, cats2.catid AS catid2, cats2.cat AS cat2, cats3.catid AS catid3, cats3.cat AS cat3 FROM vb_ldcats as cats LEFT JOIN vb_ldcats As cats1

RE: Joining a table to itself

2008-07-08 Thread Jim MacDiarmid
Thanks Shannon. :) -Original Message- From: Shannon Wade [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2008 4:04 PM To: Jim MacDiarmid Subject: Re: Joining a table to itself not sure i understand the order of your table joining i just reordered them and it works. SELECT

Joining a table to itself

2008-07-08 Thread Jim MacDiarmid
I'm hoping someone can help me with this. I have a table of categories that I'm trying to join to itself, but I keep getting the error "unknown column: Cats1.parentid in on clause". Here is the SQL for the table: CREATE TABLE `vb_ldcats` ( `catid`int(10) AUTO_INCREMENT NOT NULL

Re: joining and grouping

2008-02-28 Thread Olav Mørkrid
no that won't work, because even though the "where" excludes *my* vote for a particular candidate, it will include everybody else's vote for the same candidate. the objective is: if *i* voted for john, then john should not be in the final result set even though a million other people voted for joh

Re: joining and grouping

2008-02-27 Thread Phil
Ok then, so select candidate,count(*) as total from vote where (voter <> '$me' and vote =1) group by candidate order by total desc; On Wed, Feb 27, 2008 at 9:37 AM, Olav Mørkrid <[EMAIL PROTECTED]> wrote: > hi phil, i forgot to mention one thing. > > the table also has a column called "vote" w

Re: joining and grouping

2008-02-27 Thread Olav Mørkrid
hi phil, i forgot to mention one thing. the table also has a column called "vote" which is either 0 (no vote given) or 1 (vote given). this column is required for other purposes. my favorites: select candidate from vote where voter = '$me' and vote = 1; most popular: select candidate from vote w

Re: joining and grouping

2008-02-27 Thread Phil
I'm confused as to why you need the subselect at all? As it's all the same table why can't you just use select candidate,count(*) as total from vote where voter <> '$me' group by candidate order by total desc; On Wed, Feb 27, 2008 at 9:04 AM, Olav Mørkrid <[EMAIL PROTECTED]> wrote: > hello >

joining and grouping

2008-02-27 Thread Olav Mørkrid
hello i have a table "vote" which has the columns "voter" and "candidate". i would like to make a list of the most popular candidates *except* those who are on my favorite list. using a sub-select, it's easy: my favorites: select candidate from vote where voter = '$me'; most popular: select cand

Re: Joining question

2007-08-02 Thread Richard
Thanks!! I must have a problem with my code then !! I will check it out then. Peter Brawley a écrit : DROP TABLE IF EXISTS messages; CREATE TABLE messages( message text, reference char(10), sender char(10)); INSERT INTO MESSAGES VALUES ('message1 text' , '05' , 'M01'), ('messag

Re: Joining question

2007-08-02 Thread Peter Brawley
DROP TABLE IF EXISTS messages; CREATE TABLE messages( message text, reference char(10), sender char(10)); INSERT INTO MESSAGES VALUES ('message1 text' , '05' , 'M01'), ('message2 text' , '10' , 'M15'), ('message3 text' , '05' , 'M04'), ('message4

Re: Joining question

2007-08-02 Thread Richard
Hi My guess is I have not described my problem well enough then ... Here is an example of table one : MESSAGE | REFERENCE | SENDER message1 text | 05 | M01 message2 text | 10

Re: Joining question

2007-08-02 Thread Peter Brawley
Richard, This is elementary---you most definitely do not need to do it with PHP code. Given tables messages(senderid, message, reference) and senders(senderid, name, address), this query SELECT m.message, m.reference, s.name FROM messages m JOIN senders s ON m.senderid=s.senderid WHERE m.ref

Re: Joining question

2007-08-02 Thread Richard
I've tried it and it does not work, the problem is that there needs to be 1 table1 row for each table2 row, and table 1 is the message list and the table two is the members information list. So I need the same row to be joined to all the message rows with the same senderid ... I guess I w

Re: Joining question

2007-08-02 Thread Peter Brawley
That query will give one row per table1 row matching your WHERE clause, with matched row from table2. Is that what you want? PB Richard wrote: Thanks, I think I have found the correct syntax in a book I've got : SELECT A.message,B.name FROM table1 A JOIN table2 B ON A.senderid=B.senderid WHER

Re: Joining question

2007-08-02 Thread Peter Brawley
Richard >I have table1 containing : message, senderid, reference >and table2 contains: senderid, name, address >I want to do a query that gives me : message, reference and name ... Do you mean ... SELECT t1.message, t1.reference, t2.name FROM tbl1 t1 JOIN tbl2 ON t1.senderid=t2.senderid; PB -

Joining question

2007-08-02 Thread Richard
Hello, I'm not sure if I can use union here or what syntax I should use. I will simplify the tables to only include the necessary information. I have table1 containing : message, senderid, reference and table2 contains: senderid, name, address I want to do a query that gives me : message, refer

Re: Prefixing fields with table name when joining?

2006-12-11 Thread Visolve DB Team
AIL PROTECTED]> To: Sent: Monday, December 11, 2006 8:39 PM Subject: Prefixing fields with table name when joining? I have three tables (x, y, and z) with the same 3 fields (id, name, number). If I do: SELECT * FROM x, y, z WHERE ... each row of my result will contain 3 id fields, 3 name fiel

Prefixing fields with table name when joining?

2006-12-11 Thread Kelly Jones
I have three tables (x, y, and z) with the same 3 fields (id, name, number). If I do: SELECT * FROM x, y, z WHERE ... each row of my result will contain 3 id fields, 3 name fields, and 3 number fields. Of course, I can/should do: SELECT x.id AS x_id, x.name AS x_name, x.number AS x_number,

Re: Joining *3* tables

2006-09-29 Thread André Hänsel
> -Ursprüngliche Nachricht- > Von: Renito 73 [mailto:[EMAIL PROTECTED] > Gesendet: Samstag, 30. September 2006 04:20 > An: mysql@lists.mysql.com > Betreff: Joining *3* tables > > Hello list Hello Mr 73, > I have a large database of contacts, but since not

Joining *3* tables

2006-09-29 Thread Renito 73
If I want to generate a report with address, company and list (category) how can I join the three tables with a single query? or should I first generate a temporal table with the result of the first join and then a second one joining the third table? Thanks for your comments -- MySQL Gener

Re: Joining result sets into 1 row

2006-08-14 Thread Ow Mun Heng
On Mon, 2006-08-14 at 05:43 -0700, Steffan A. Cline wrote: > Here is a better example > > mysql> select listName from listItem limit 3; > +-+ > | listName| > +-+ > | PWC | > | Small Boats | > | Fiberglass | > +-+ > 3 rows in set (0.02 sec) > > mysq

Re: Joining result sets into 1 row

2006-08-14 Thread Brad Jahnke
> I want to have the rows returned as one row > Such as > ROW 1 Mechanic, Carpenter, Plumber You may want to try GROUP_CONCAT(expr) ... http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscr

Re: Joining result sets into 1 row

2006-08-14 Thread Brent Baisley
I think what you are looking for is GROUP_CONCAT. Without more info I can't really tell though. http://dev.mysql.com/doc/refman/4.1/en/group-by-functions.html - Original Message - From: "Steffan A. Cline" <[EMAIL PROTECTED]> To: Sent: Sunday, August 13, 2006 6:5

Re: Joining result sets into 1 row

2006-08-13 Thread Ow Mun Heng
On Sun, 2006-08-13 at 15:53 -0700, Steffan A. Cline wrote: > I am in a situation where I have say 1 column called "attribute" I need and > the result set is 3 rows. i.e. > ROW 1 - Mechanic > ROW 2 - Carpenter > ROW 3 - Plumber > I want to have the rows returned as one row > Such as > ROW 1 Mechani

Joining result sets into 1 row

2006-08-13 Thread Steffan A. Cline
I am in a situation where I have say 1 column called "attribute" I need and the result set is 3 rows. i.e. ROW 1 - Mechanic ROW 2 - Carpenter ROW 3 - Plumber I want to have the rows returned as one row Such as ROW 1 Mechanic, Carpenter, Plumber Something like a literal join would be beautiful suc

Re: joining tables

2006-08-10 Thread Peter Brawley
Reinhart, >So even the clients who have no entry in events on that day, but they have >an event in that specific month and year should be shown with a 0 value. Try ...FROM clients LEFT JOIN events... PB - Reinhart Viane wrote: Table1: events Durationworkdateclientid

joining tables

2006-08-10 Thread Reinhart Viane
Table1: events Durationworkdateclientidpersonid 60 2006-01-03 1 51 48 2006-01-03 2 51 167 2006-01-03 4 51 Table2: clients Clientidname 1 client1 2

Re: Joining multiple tables with grouping functions

2006-05-26 Thread Jay Pipes
Ville Mattila wrote: I try to get a list of all Invoices with total sum of the invoice and paid sum of each invoices, as well as a customer name. I try following query: SELECT Invoices.*, SUM(InvoiceContents.Amount * InvoiceContents.Price) AS InvoiceTotal, Customers.Name, SUM(Payments.Amount) Pa

Re: Joining multiple tables with grouping functions

2006-05-26 Thread Peter Brawley
Ville, >SELECT Invoices.*, SUM(InvoiceContents.Amount * InvoiceContents.Price) >AS InvoiceTotal, Customers.Name, SUM(Payments.Amount) PaidTotal, >MAX(Payments.Date) LastPayment FROM Invoices LEFT JOIN InvoiceContents >ON (InvoiceContents.InvoiceID = Invoices.ID) LEFT JOIN Customers ON >(Customers

Joining multiple tables with grouping functions

2006-05-26 Thread Ville Mattila
Hello all, I'm sure that this situation is one of the most wondered questions with JOIN clauses. Anyway, I couldn't find any clear information how to carry out multiple joins in one query with proper results. I have four tables: 1. Invoices 2. InvoiceContents 3. Customers 4. Payments I try to ge

Re: How do I get off this list that I do not remember joining in the first place!!!!

2006-05-25 Thread Daniel Kasak
Phil Robbins wrote: I've read the notice AND tried to unsubscribe TWICE. I still get the mail. Did you get an unsubscription confirmation email? I'm not sure if the mysql list sends one of these or not. If it does, you have to do what it says in the confirmation before you are unsubscribed.

Re: How do I get off this list that I do not remember joining in the first place!!!!

2006-05-25 Thread James Harvard
At 11:55 am +1200 26/5/06, Phil Robbins wrote: >I've read the notice AND tried to unsubscribe TWICE. I still get the mail. http://lists.mysql.com/troubleshoot.php HTH, James Harvard -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mys

Re: How do I get off this list that I do not remember joining in the first place!!!!

2006-05-25 Thread Phil Robbins
I've read the notice AND tried to unsubscribe TWICE. I still get the mail. ++ Phil Robbins Auckland New Zealand ++ _ Need more speed? Get Xtra Broadband @ http://jetstream.xtra.co.nz/chm/0,,202853

RE: How do I get off this list that I do not remember joining in the first place!!!!

2006-05-24 Thread Tim Lucia
There may be a clue at the bottom of every message ;-) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: How do I get off this list that I do not remember joining in the first place!!!!

2006-05-24 Thread Daniel Kasak
Phil Robbins wrote: Perhaps you should read the notice at the bottom of each post that you receive from the list !!! -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 ema

How do I get off this list that I do not remember joining in the first place!!!!

2006-05-24 Thread Phil Robbins
++ Phil Robbins Auckland New Zealand ++ _ Discover fun and games at @ http://xtramsn.co.nz/kids -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: joining 3 tables

2006-02-14 Thread Peter Brawley
Amy, You didn't mention what the problem is with your query... select reference.uid from reference, subject_name, ref_cat where subject_name.sub_id = '45' and ref_cat.ref_cat_id = '3' and ref_cat.ref_cat_id = reference.ref_cat_id and subject_name.sub_id = ref_cat.sub_id IAC it is easier to unde

Re: joining 3 tables

2006-02-14 Thread Thomas Spahni
On Tue, 14 Feb 2006, Amy Thornton wrote: > I am trying to join 3 tables together. > > Table A has 3 fields: sub_id, subject, id > Table B has 3 fields: ref_cat_id, sub_id, ref_cat > Table C has 7 fields: uid, ref_cat_id, etc. > > I am trying to join Table A and B over sub_id and join B and C over

joining 3 tables

2006-02-14 Thread Amy Thornton
I am trying to join 3 tables together. Table A has 3 fields: sub_id, subject, id Table B has 3 fields: ref_cat_id, sub_id, ref_cat Table C has 7 fields: uid, ref_cat_id, etc. I am trying to join Table A and B over sub_id and join B and C over ref_cat_id while pulling in the value of sub_id and r

Help on query joining a 3rd table

2006-01-29 Thread pedro mpa
Solved. Thanks. -Mensagem original- De: pedro mpa [mailto:[EMAIL PROTECTED] Enviada: domingo, 29 de Janeiro de 2006 18:25 Para: mysql@lists.mysql.com Assunto: Help on query joining a 3rd table Hello! I am building a query to get a monthly total for receipts and receipts plus TAX. My

Help on query joining a 3rd table

2006-01-29 Thread pedro mpa
Hello! I am building a query to get a monthly total for receipts and receipts plus TAX. My problem is the TAX, it can be different for each receipt. I need help on including and relating each TAX value/id with each receipt, like receipt_items.price * 1.21 etc. The tables are like the following ex

Re: Help in joining three tables

2006-01-18 Thread Rhino
- Original Message - From: <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Cc: "Imran" <[EMAIL PROTECTED]>; Sent: Wednesday, January 18, 2006 5:07 PM Subject: Re: Help in joining three tables "Rhino" <[EMAIL PROTECTED]> wrot

Re: Help in joining three tables

2006-01-18 Thread SGreen
"Rhino" <[EMAIL PROTECTED]> wrote on 01/18/2006 03:30:44 PM: > > - Original Message - > From: "Imran" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, January 18, 2006 3:13 PM > Subject: Help in joining three tables > > > > He

Re: Help in joining three tables

2006-01-18 Thread Rhino
- Original Message - From: "Imran" <[EMAIL PROTECTED]> To: Sent: Wednesday, January 18, 2006 3:13 PM Subject: Help in joining three tables Hello All: I need to join three tables but I am not sure how to structure the query. I need to join table1 to table2 and the

Re: Help in joining three tables

2006-01-18 Thread gerald_clark
Please do not hijack someone elses thread. ]Imran wrote: Hello All: I need to join three tables but I am not sure how to structure the query. I need to join table1 to table2 and then join table3 to this result set. So like (table1 join table2) join table3. Table1 and Table2 will be joined o

Re: Help in joining three tables

2006-01-18 Thread SGreen
"Imran" <[EMAIL PROTECTED]> wrote on 01/18/2006 03:13:08 PM: > Hello All: > > I need to join three tables but I am not sure how to structure the query. > I need to join table1 to table2 and then join table3 to this result set. > > So like (table1 join table2) join table3. > > Table1 and Table

Help in joining three tables

2006-01-18 Thread Imran
Hello All: I need to join three tables but I am not sure how to structure the query. I need to join table1 to table2 and then join table3 to this result set. So like (table1 join table2) join table3. Table1 and Table2 will be joined on ProdNo,CustNo and Branch. Table3 will be joined to the resu

Re: Joining tables, duplicating none

2005-10-10 Thread Joerg Bruehe
Hi Jonathan, all! Jonathan Mangin wrote: I have two tables with date and uid cols. in common. Table 1 has one row per date, Table 2 has a maximum of 7 rows per date. select t1.date, t1.val, t2.val from t1 right join t2 on t1.date = t2.date where t1.date between '2005-08-01' and '2005-08-14' an

Re: Joining tables, duplicating none

2005-10-08 Thread Gleb Paharenko
Hello. > select t1.date, t1.val, t2.val from t1 > right join t2 on t1.date = t2.date > where t1.date between '2005-08-01' and '2005-08-14' > and t1.uid = 'me'; Maybe it is better to move a condition on t1 fields from WHERE to ON part of the query? Or I don't see any sense in using a RIGH

Re: Joining tables, duplicating none

2005-10-07 Thread SGreen
"Jonathan Mangin" <[EMAIL PROTECTED]> wrote on 10/07/2005 03:47:48 PM: > > - Original Message - > From: <[EMAIL PROTECTED]> > To: "Jonathan Mangin" <[EMAIL PROTECTED]> > Cc: > Sent: Friday, October 07, 2005 2:09 PM > Subjec

Re: Joining tables, duplicating none

2005-10-07 Thread Jonathan Mangin
- Original Message - From: <[EMAIL PROTECTED]> To: "Jonathan Mangin" <[EMAIL PROTECTED]> Cc: Sent: Friday, October 07, 2005 2:09 PM Subject: Re: Joining tables, duplicating none "Jonathan Mangin" <[EMAIL PROTECTED]> wrote on 10/07/2005 02:57:28

Re: Joining tables, duplicating none

2005-10-07 Thread Peter Brawley
Jonathan, >I have two tables with date and uid cols. in common. >Table 1 has one row per date, Table 2 has a maximum >of 7 rows per date. >select t1.date, t1.val, t2.val from t1 >right join t2 on t1.date = t2.date >where t1.date between '2005-08-01' and '2005-08-14' >and t1.uid = 'me'; A right

Re: Joining tables, duplicating none

2005-10-07 Thread SGreen
"Jonathan Mangin" <[EMAIL PROTECTED]> wrote on 10/07/2005 02:57:28 PM: > I have two tables with date and uid cols. in common. > Table 1 has one row per date, Table 2 has a maximum > of 7 rows per date. > > select t1.date, t1.val, t2.val from t1 > right join t2 on t1.date = t2.date > where t1.dat

Joining tables, duplicating none

2005-10-07 Thread Jonathan Mangin
I have two tables with date and uid cols. in common. Table 1 has one row per date, Table 2 has a maximum of 7 rows per date. select t1.date, t1.val, t2.val from t1 right join t2 on t1.date = t2.date where t1.date between '2005-08-01' and '2005-08-14' and t1.uid = 'me'; +-

Re: Joining data from two databases

2005-09-27 Thread Jasper Bryant-Greene
Anthony Brown wrote: I have one database that I would like to split into two.. Well actually my client does.. I don't think we should. But, is there a way to join data from the seperated databases? One table authors will be connected to a table called contacts each residing in different databas

Joining data from two databases

2005-09-27 Thread Anthony Brown
Hi, I have one database that I would like to split into two.. Well actually my client does.. I don't think we should. But, is there a way to join data from the seperated databases? One table authors will be connected to a table called contacts each residing in different databases on the same ser

Re: Joining tables - restricting selected records

2005-06-28 Thread Michael Stassen
Mathias wrote: sorry if i wasn't clear. i mean not select puchase_date, but max(purchase_date), i.e. use having clause. The join field is certainly customerId, or There is not sufficient info on tables. Hope that helps :o) Mathias How would you do that with HAVING? I believe the subque

Re: Joining tables - restricting selected records

2005-06-28 Thread Mathias
Selon Michael Stassen <[EMAIL PROTECTED]>: > Mathias wrote: > > > Selon Russell Horn <[EMAIL PROTECTED]>: > > > >>This must have come up before, but I've not found it using a google > >>search. > >> > >>I have two tables customer and purchases > >> > >>customer: > >> customerID > >> customerName

Re: Joining tables - restricting selected records

2005-06-28 Thread Michael Stassen
Mathias wrote: Selon Russell Horn <[EMAIL PROTECTED]>: This must have come up before, but I've not found it using a google search. I have two tables customer and purchases customer: customerID customerName purchases: purchaseID customerID purchaseDate purchaseValue Is it possible in

Re: Joining tables - restricting selected records

2005-06-28 Thread Mathias
Selon Russell Horn <[EMAIL PROTECTED]>: > This must have come up before, but I've not found it using a google > search. > > I have two tables customer and purchases > > customer: > customerID > customerName > > purchases: > purchaseID > customerID > purchaseDate > purchaseValue > > Is

Joining tables - restricting selected records

2005-06-28 Thread Russell Horn
This must have come up before, but I've not found it using a google search. I have two tables customer and purchases customer: customerID customerName purchases: purchaseID customerID purchaseDate purchaseValue Is it possible in MySQL to join the tables so I only get the value of t

Re: Query help - Joining adjacent rows?

2005-06-21 Thread Jochem van Dieten
On 6/21/05, comex wrote: > I have a table: > create table example(time datetime, username varchar(255)); Please tell me you didn't actualy use "time" as identifier :) > timeusername > 2005-06-21 15:58:02 user1 > 2005-06-21 14:58:02 user1 > 2005-06-21 11:57:51 user2 > 2005-06-21 1

Re: Query help - Joining adjacent rows?

2005-06-21 Thread comex
> How would you like to see that information GROUPed and what does that > grouping represent (physically). In essence, I am asking you to describe > what information you are determining by the grouping process, what does each > GROUP mean to you? Grouping just means that somebody visited twice in

Re: Query help - Joining adjacent rows?

2005-06-21 Thread SGreen
comex <[EMAIL PROTECTED]> wrote on 06/21/2005 12:46:00 PM: > > Basically it boils down to the fact that with SQL you have to use > some other way of telling > > each group apart other than position (or interposition, as you say > in your example). The fact > > that you have entries in your table

Re: Query help - Joining adjacent rows?

2005-06-21 Thread comex
> Basically it boils down to the fact that with SQL you have to use some other > way of telling > each group apart other than position (or interposition, as you say in your > example). The fact > that you have entries in your table from user1, user1, user2, user1, user2, > user3, and user1 > doe

Re: Query help - Joining adjacent rows?

2005-06-21 Thread SGreen
comex <[EMAIL PROTECTED]> wrote on 06/21/2005 11:07:35 AM: > I have a table: > create table example(time datetime, username varchar(255)); > timeusername > 2005-06-21 15:58:02 user1 > 2005-06-21 14:58:02 user1 > 2005-06-21 11:57:51 user2 > 2005-06-21 10:57:51 user1 > 2005-06-2

Re: Query help - Joining adjacent rows?

2005-06-21 Thread Mihail Manolov
Will this work? GROUP BY maxtime, user ORDER BY maxtime DESC comex wrote: I have a table: create table example(time datetime, username varchar(255)); timeusername 2005-06-21 15:58:02 user1 2005-06-21 14:58:02 user1 2005-06-21 11:57:51 user2 2005-06-21 10:57:51 user1 2005-0

Query help - Joining adjacent rows?

2005-06-21 Thread comex
I have a table: create table example(time datetime, username varchar(255)); timeusername 2005-06-21 15:58:02 user1 2005-06-21 14:58:02 user1 2005-06-21 11:57:51 user2 2005-06-21 10:57:51 user1 2005-06-21 09:57:51 user1 The query: select COUNT(*), username, MAX(time) as max

Re: help joining tables in a query

2005-06-16 Thread Danny Stolle
James M. Gonzalez wrote: -Original Message- From: Danny Stolle [mailto:[EMAIL PROTECTED] Sent: 15 June 2005 21:09 To: James M. Gonzalez Subject: Re: help joining tables in a query James M. Gonzalez wrote: Greetings, I'm facing a difficult query at the moment. I have tried

help joining tables in a query

2005-06-15 Thread James M. Gonzalez
shipped WHERE (YEAR(shipdate) = 2004) AND (MONTH(shipdate) = 05) GROUP BY shipdate ORDER BY shipdate DESC However, joining the 3 tables and getting the right results is being a nightmare. I have already tried different left and right joins, with no success. Please any help, hints, or lig

Re: A question of joining...

2005-05-17 Thread Critters
Thankyou, That worked a treat! Thankyou so very much -- David Scott - Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Critters" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, May 17, 2005 5:01 PM Subject: Re: A question of joining... Critters

Re: A question of joining...

2005-05-17 Thread Michael Stassen
Critters wrote: Hi, I am having problems with the JOIN function. MESSAGES memberID_1, memberID_2, Message MEMBERS id, name I can only manage to replace the "memberID_1" in MESSAGES with the "name" in MEMBERS, I can not replace both memberID_1 and memberID_2 with "name". Please can someone tell me

A question of joining...

2005-05-17 Thread Critters
Hi, I am having problems with the JOIN function. MESSAGES memberID_1, memberID_2, Message MEMBERS id, name I can only manage to replace the "memberID_1" in MESSAGES with the "name" in MEMBERS, I can not replace both memberID_1 and memberID_2 with "name". Please can someone tell me what I shoul

Re: joining six tables by mutual column

2005-05-02 Thread Michael Stassen
Schalk Neethling wrote: Mathias/Everyone on the list I am running the following query against the database: SELECT demographic.demographic_no, demographic.first_name, demographic.last_name, demographic.chart_no, demographic.sex, demographic.year_of_birth, demographic.month_of_birth, demographic.

Re: joining six tables by mutual column

2005-05-02 Thread Peter Brawley
6.col and T1.col=T6.col [and col='val'] Doesn't this work ? Have you an example ? Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer -Original Message- From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: lun

Re: joining six tables by mutual column

2005-05-02 Thread Schalk Neethling
#x27;t this work ? Have you an example ? Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer -Original Message- From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: lundi 25 avril 2005 00:52 To: mysql@lists.mysql.com Subject: j

Re: joining six tables by mutual column

2005-04-25 Thread Nick Pasich
Try this If something is numeric SELECT * FROM table1, table2, table3, table4, table5, table6 WHERE table1.something = table2.something AND table1.something = table3.something AND table1.something = table4.something AND table1.something = table5.something

RE: joining six tables by mutual column

2005-04-25 Thread mathias fatene
? Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer -Original Message- From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: lundi 25 avril 2005 00:52 To: mysql@lists.mysql.com Subject: joining six tables by mutual column Greetings everyone. Hope s

Re: joining six tables by mutual column

2005-04-24 Thread Richard Lynch
On Sun, April 24, 2005 3:51 pm, Schalk Neethling said: > Hope someone can give me some pointers here. I have six tables in the > database and I need to JOIN them on a row that appears in all of the > tables. How do I do this? I have so far done the normal 'cross-join' > saying SELECT * FROM table1,

joining six tables by mutual column

2005-04-24 Thread Schalk Neethling
Greetings everyone. Hope someone can give me some pointers here. I have six tables in the database and I need to JOIN them on a row that appears in all of the tables. How do I do this? I have so far done the normal 'cross-join' saying SELECT * FROM table1, table2, table3, table4, table5, table6

Joining on non unique index is irrationally slow, I can beat join performance with stored procedure 100 fold!!!!

2005-02-21 Thread Bereczki Gabor
Hi, I am working with 5.0.3 snapshot on x86_64. I am now experiencing with features of MySQL, so please ignore that in my example I use self join . I know that this particular example could be done much easier but eventually I am going to join multiple tables with similar structure (one preprocess

Re: Complex joining - multiple tables to one

2005-01-04 Thread SGreen
It's probably your JOIN on shipped items producing a cross product with your JOIN on ordered items. What happens if you take the entire "shippeditems" JOIN out of your statement? Are your numbers still off? Since your query is not using data from that table you should be able to eliminate it f

Complex joining - multiple tables to one

2005-01-03 Thread Ville Mattila
Hi there! I have some problems with the complex MySQL join operations. In most cases, LEFT JOIN fulfills my needs but sometimes it doesn't work in the expected way. I'll give an example: orders -- - orderid - customerid customers - - id - customername orderitems -- - itemid -

Re: Performance of Joining Tables From Different Storage Engines -- Re: MyISAM vs. InnoDB for heavily-indexed, read-mostly data

2004-12-21 Thread Homam S.A.
the information. Yes, Emmett > mentioned > >the same thing in a private message, and it seems > that > >MyISAM is exactly what I'm looking for: a > >heavily-indexed large table that will be also > indexed > >for full-text search and built off-line -- no >

  1   2   3   >