Re: Using Joins/Unions

2015-08-06 Thread Wm Mussatto
mussa...@csz.com wrote: On Tue, August 4, 2015 11:19, Ryan Coleman wrote: I have been a MySQL user and supporter for over a decade (since 2001) and I am almost ashamed to admit that I haven’t the faintest idea on how to do joins and unions. I have a specific query I would love to run… I have

Re: Using Joins/Unions

2015-08-04 Thread Ryan Coleman
, Ryan Coleman wrote: I have been a MySQL user and supporter for over a decade (since 2001) and I am almost ashamed to admit that I haven’t the faintest idea on how to do joins and unions. I have a specific query I would love to run… I have two tables, one with Unique data (“images”) and one

Using Joins/Unions

2015-08-04 Thread Ryan Coleman
I have been a MySQL user and supporter for over a decade (since 2001) and I am almost ashamed to admit that I haven’t the faintest idea on how to do joins and unions. I have a specific query I would love to run… I have two tables, one with Unique data (“images”) and one with corresponding

Re: Using Joins/Unions

2015-08-04 Thread Wm Mussatto
On Tue, August 4, 2015 11:19, Ryan Coleman wrote: I have been a MySQL user and supporter for over a decade (since 2001) and I am almost ashamed to admit that I haven’t the faintest idea on how to do joins and unions. I have a specific query I would love to run… I have two tables, one

NEW Server Joins Tables from Multiple Servers with Unprecedented Speed

2014-03-03 Thread Hiromichi Watari
Parallel Universe* now features Parallel Network Query (Distributed Query) which joins tables from multiple servers in the network with unprecedented speed. Parallel Network Query may also be used to speed up slow server by distributing tables of the query to multiple servers for processing which

RE: Composite Index Usage in Joins

2012-07-13 Thread Rick James
: Jeffrey Grollo [mailto:grol...@gmail.com] Sent: Tuesday, July 10, 2012 2:50 PM To: mysql@lists.mysql.com Subject: Composite Index Usage in Joins Hi, I'm attempting to optimize a join and am having a difficult time using multiple columns from a composite index. The second column of the composite

Re: Composite Index Usage in Joins

2012-07-12 Thread Jeffrey Grollo
Thanks for the guidance and references, Shawn. On Wed, Jul 11, 2012 at 3:37 PM, Shawn Green shawn.l.gr...@oracle.com wrote: Ranged scans only happen for the last portion of an index being used. OR queries (or those using IN) can also only be applied to the last part of an index search. This

Re: Composite Index Usage in Joins

2012-07-12 Thread Jeffrey Grollo
On Wed, Jul 11, 2012 at 5:30 PM, Sergei Petrunia pser...@askmonty.org wrote: I can provide a refutation. Ability to make a combined index access of 1. Equality with a non-constant: t.sec_id= p.sec_id 2. non-equality comparison with constants, trade_time IN ('2012-07-01', '2012-07-02') has

Re: Composite Index Usage in Joins

2012-07-11 Thread Shawn Green
On 7/10/2012 5:50 PM, Jeffrey Grollo wrote: Hi, I’m attempting to optimize a join and am having a difficult time using multiple columns from a composite index. The second column of the composite key is being used when tested for equality, but not for IN or BETWEEN criteria. As an example, say

Re: Composite Index Usage in Joins

2012-07-11 Thread Sergei Petrunia
On Tue, Jul 10, 2012 at 05:50:07PM -0400, Jeffrey Grollo wrote: Hi, I’m attempting to optimize a join and am having a difficult time using multiple columns from a composite index. The second column of the composite key is being used when tested for equality, but not for IN or BETWEEN

Composite Index Usage in Joins

2012-07-10 Thread Jeffrey Grollo
Hi, I’m attempting to optimize a join and am having a difficult time using multiple columns from a composite index. The second column of the composite key is being used when tested for equality, but not for IN or BETWEEN criteria. As an example, say that I’m searching two tables: portfolio and

RE: forcing mysql to use batched key access (BKA) optimization for joins

2012-04-17 Thread Rick James
, 2012 5:20 PM To: mysql@lists.mysql.com Subject: Re: forcing mysql to use batched key access (BKA) optimization for joins 2012/04/10 15:58 -0400, Stephen Tu select c_custkey, c_name, sum(l_extendedprice * (100 - l_discount)) as revenue, c_acctbal, n_name, c_address, c_phone

Re: forcing mysql to use batched key access (BKA) optimization,for joins

2012-04-11 Thread Øystein Grøvlen
Hi Stephen, 2012/04/10 15:58 -0400, Stephen Tu | id | select_type | table| type | possible_keys | key | key_len | ref | rows| Extra |

Re: forcing mysql to use batched key access (BKA) optimization for joins

2012-04-10 Thread Hal�sz S�ndor
2012/04/10 15:58 -0400, Stephen Tu select c_custkey, c_name, sum(l_extendedprice * (100 - l_discount)) as revenue, c_acctbal, n_name, c_address, c_phone, c_comment from CUSTOMER_INT, ORDERS_INT, LINEITEM_INT, NATION_INT where c_custkey = o_custkey and l_orderkey =

Re: Multiple joins from same table?

2009-12-12 Thread Shawn Green
Terry Van de Velde wrote: Good Day, I am attempting to do something new (to me) with MySQL. I am looking to have my query return with the value in the visitor and home columns replaced with the corresponding team name from the teams table. schedule.visitor and schedule.home are essentially

RE: Multiple joins from same table?

2009-12-12 Thread Terry Van de Velde
-Original Message- From: shawn.gr...@sun.com [mailto:shawn.gr...@sun.com] Sent: December 12, 2009 4:39 PM To: Terry Van de Velde Cc: mysql@lists.mysql.com Subject: Re: Multiple joins from same table? Terry Van de Velde wrote: Good Day, I am attempting to do something new (to me) with MySQL. I

Multiple joins from same table?

2009-12-10 Thread Terry Van de Velde
Good Day, I am attempting to do something new (to me) with MySQL. I am looking to have my query return with the value in the visitor and home columns replaced with the corresponding team name from the teams table. schedule.visitor and schedule.home are essentially foreign keys to

Re: Multiple joins from same table?

2009-12-10 Thread Gary Smith
Terry Van de Velde wrote: Good Day, I am attempting to do something new (to me) with MySQL. I am looking to have my query return with the value in the visitor and home columns replaced with the corresponding team name from the teams table. schedule.visitor and schedule.home are essentially

Is a view efficient in joins?

2009-11-29 Thread Neil Aggarwal
Hello: I have a database with over 60 tables with thousands to millions or rows in each. I want to develop a summary of the data joined across all the tables. I can do this with a view, but I am concerned it will take a lot of resources to perform all the joins required by the view. Is a view

Re: Is a view efficient in joins?

2009-11-29 Thread Jim Lyons
A view is no more or less efficient that the queries that make it up. Each time you invoke the view, you repeat all the joins. A join could be more efficient only if you go to a lot of effort to ensure it forms the most efficient join(s) of the underlying tables. Your solution of the summary

RE: Is a view efficient in joins?

2009-11-29 Thread Neil Aggarwal
Jim: A view is no more or less efficient that the queries that make it up. Each time you invoke the view, you repeat all the joins. That is what I was afraid of. With the large number of tables I have, the joins are going to take a lot of cycles to run. Your solution of the summary table

Re: self-joins in hierarchical queries: optimization problem

2009-10-30 Thread Olga Lyashevska
Dear Michail and Sergey, Thank you very much for your responses and kind suggestions! On 29.10.2009, at 16:53, Sergey Petrunya wrote: this makes it clear that index on O1.tsn will not be useful. You need indexes on parent_tsn column. mysql alter table taxonomic_units1 add index

self-joins in hierarchical queries: optimization problem

2009-10-29 Thread Olga Lyashevska
| | ++-+---+--+---+--+- +--++---+ 6 rows in set (0.00 sec) What is wrong with this query? Or is it a problem of all adjacency list models? Is there a way to get columns indexed using self-joins? Thanks, Olga -- MySQL General Mailing List

Re: self-joins in hierarchical queries: optimization problem

2009-10-29 Thread kabel
Not sure if this is the exact problem you're trying to solve, but this helped me in a similar situation. http://dev.mysql.com/tech-resources/articles/hierarchical-data.html kabel -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: self-joins in hierarchical queries: optimization problem

2009-10-29 Thread Olga Lyashevska
Thanks Kabel, Not sure if this is the exact problem you're trying to solve, but this helped me in a similar situation. http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Yes, I have seen this article before, and it is really nice. However they do not discuss any

Re: self-joins in hierarchical queries: optimization problem

2009-10-29 Thread Sergey Petrunya
adjacency list models? Is there a way to get columns indexed using self-joins? For an outer join like ... taxonomic_units1 AS O1 LEFT OUTER JOIN taxonomic_units1 AS O2 ON O1.tsn = O2.parent_tsn current optimizer has only one option(*): use Nested-Loops Join algorthm, with the outer table being

Re: self-joins in hierarchical queries: optimization problem

2009-10-29 Thread Sergey Petrunya
On Thu, Oct 29, 2009 at 07:53:25PM +0300, Sergey Petrunya wrote: ... taxonomic_units1 AS O1 LEFT OUTER JOIN taxonomic_units1 AS O2 ON O1.tsn = O2.parent_tsn current optimizer has only one option(*): use Nested-Loops Join algorthm, with the outer table being the first one. That is, it

Re: self-joins in hierarchical queries: optimization problem

2009-10-29 Thread Mikhail Berman
| | ++-+---+--+---+--+-+--++---+ 6 rows in set (0.00 sec) What is wrong with this query? Or is it a problem of all adjacency list models? Is there a way to get columns indexed using self-joins? Thanks, Olga -- MySQL General Mailing List For list

Re: Nested Joins

2009-10-02 Thread Victor Subervi
*From:* Victor Subervi [mailto:victorsube...@gmail.com] *Sent:* Thursday, October 01, 2009 3:04 PM *To:* Gavin Towey; mysql@lists.mysql.com *Subject:* Re: Nested Joins Well, your syntax is *exactly* what I had (with a few cosmetic changes). I've been over the MySQL manual on joins

Nested Joins

2009-10-01 Thread Victor Subervi
Hi; I'm new to join statements. Here's my python syntax: cursor.execute('select * from %s left join products on %s.Item=products.Item (left join categories on products.Category=categories.ID);' % (client, client)) I believe it's clear how I want to nest, but I don't know how to repair my

RE: Nested Joins

2009-10-01 Thread Gavin Towey
Joins aren't nested like that, unless you use a subquery. I think you just need to remove the parens around the second join. For better help: 1. show the real SQL -- echo the statement. Most people here don't like looking at app code because your variables could contain anything. 2. Give

Re: Nested Joins

2009-10-01 Thread Victor Subervi
On Thu, Oct 1, 2009 at 4:03 PM, Gavin Towey gto...@ffn.com wrote: Joins aren't nested like that, unless you use a subquery. I think you just need to remove the parens around the second join. I tried that and no go :( For better help: 1. show the real SQL -- echo the statement. Most

RE: Nested Joins

2009-10-01 Thread Gavin Towey
on p.Category=cat.ID Make your code produce the above, and you should be fine. I suspect you don't need LEFT JOIN there, an inner join will suffice. For more info on joins: http://hashmysql.org/index.php?title=Introduction_to_Joins For more indepth info: http://dev.mysql.com/tech-resources/articles

Re: Nested Joins

2009-10-01 Thread Victor Subervi
Well, your syntax is *exactly* what I had (with a few cosmetic changes). I've been over the MySQL manual on joins with no luck. I'll read over your resources tonight. Any other ideas would be appreciated. Thanks, V On Thu, Oct 1, 2009 at 4:49 PM, Gavin Towey gto...@ffn.com wrote: Victor

RE: Nested Joins

2009-10-01 Thread Gavin Towey
the query you're building to a string, then printing it out so you know *exactly* what you're sending to mysql. Regards, Gavin Towey From: Victor Subervi [mailto:victorsube...@gmail.com] Sent: Thursday, October 01, 2009 3:04 PM To: Gavin Towey; mysql@lists.mysql.com Subject: Re: Nested Joins Well, your

Re: Newbie --- JOINS

2009-04-11 Thread Shawn Green
going well so far, and several ColdFusion pages written already. Need to do one for a Purchase Order Report for ... - given SupplierCode - given StartDate and EndDate of Orders My problem is in the CFquery - understanding what JOINS to use and in what order to use them. Which kind

Newbie --- JOINS

2009-04-08 Thread BobSharp
ColdFusion pages written already. Need to do one for a Purchase Order Report for ... - given SupplierCode - given StartDate and EndDate of Orders My problem is in the CFquery - understanding what JOINS to use and in what order to use them. (it is a MyISAM database

Newbie and JOINS

2009-04-07 Thread BobSharp
- understanding what JOINS to use and in what order to use them. (it is a MyISAM database = no constraints) -- I am using the free version of SPAMfighter. We are a community of 6 million users fighting spam. SPAMfighter has removed 12908 of my spam emails to date. Get the free SPAMfighter here: http

Re: Are equi-joins faster than left joins?

2009-04-05 Thread Martijn Tonies
I have 3 tables that are 1:1 and will always have a row for a given product,_code date. If I want to join them together, is it going to be faster to use an equi join or a left join, or does it matter? Who cares, they are -different- things symantically, use the correct type of join for

Re: Are equi-joins faster than left joins?

2009-04-04 Thread Arthur Fuller
IIRC it does not matter. But you can double-check my opinion with EXPLAIN. A. On Thu, Mar 12, 2009 at 11:41 AM, mos mo...@fastmail.fm wrote: I have 3 tables that are 1:1 and will always have a row for a given product,_code date. If I want to join them together, is it going to be faster to

Re: Are equi-joins faster than left joins?

2009-04-04 Thread Rob Wultsch
On Thu, Mar 12, 2009 at 8:41 AM, mos mo...@fastmail.fm wrote: I have 3 tables that are 1:1 and will always have a row for a given product,_code date. If I want to join them together, is it going to be faster to use an equi join or a left join, or does it matter? IIRC:With an inner join the

Are equi-joins faster than left joins?

2009-04-02 Thread mos
I have 3 tables that are 1:1 and will always have a row for a given product,_code date. If I want to join them together, is it going to be faster to use an equi join or a left join, or does it matter? TIA Mike -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

SELECT with JOINs

2009-03-15 Thread BobSharp
of JOINs, to give the following output ... 1) Who is assigned what assets? 2) What maintenance has been carried out on each asset? 3) Which assets have not undergone any maintenance? 4) Who hasn't been assigned any assets? 5) Which assets have not been scheduled for maintenance? 6

Re: left joins concat

2009-02-22 Thread Claudio Nanni
Hi Phil, you seem quite a bit confused! I would not step to use joins before understanding the 'simple' logic behind, otherwise you will be always confused by the syntax. There are many, many, many resources (thanks to Tim!) I will try to give you a simple overview of joins but please get more

Re: left joins concat

2009-02-22 Thread PJ
Claudio Nanni wrote: Hi Phil, you seem quite a bit confused! I would not step to use joins before understanding the 'simple' logic behind, otherwise you will be always confused by the syntax. There are many, many, many resources (thanks to Tim!) I will try to give you a simple overview

Re: left joins concat

2009-02-22 Thread PJ
quite a bit confused! I would not step to use joins before understanding the 'simple' logic behind, otherwise you will be always confused by the syntax. There are many, many, many resources (thanks to Tim!) I will try to give you a simple overview of joins but please get more confortable

Re: left joins concat

2009-02-22 Thread Walter Heck
a proper column name though. In your example, the concat_ws expresion has an alias so in the queries result this name will be used instead of the expression used to select. A propos: The problem with your first query was that you were using natural joins. Natural joins match up all columns

Re: left joins concat

2009-02-22 Thread PJ
of the expression used to select. A propos: The problem with your first query was that you were using natural joins. Natural joins match up all columns that have the same name in both tables automatically. I consider it bad practice to use it as it might have unexpected results, especially when you alter

left joins concat

2009-02-21 Thread PJ
I have been searching and searching for a clear and logical explanation of JOINs and have found nothing that can be reasonably understood. Perhaps I am dense or from another planet, but nothing seems to fall into place. I need to display all the books (with their respective authors and publishers

Conditional Joins

2008-12-23 Thread Christoph Boget
= 'Plates' AND Plates.Id = Inventory.ItemId LEFT OUTER JOIN Cups ON Inventory.ItemType = 'Cups' AND Cups.Id = Inventory.ItemId LEFT OUTER JOIN Flatware ON Inventory.ItemType = 'Flatware' AND Flatware.Id = Inventory.ItemId WHERE Inventory.id IN (2, 4, 5) In the query above, the joins on both

Why are joins between tables in dif db so slow?

2008-10-03 Thread mos
I have two indexed MyISAM tables, each in a separate database. If I do a left join on the two tables, it takes 2 minutes to return the 5,000 rows. The same join on similar tables in the same database would take 5-10 seconds. Both databases are on the same drive. So why is it 10x slower when

Re: Why are joins between tables in dif db so slow?

2008-10-03 Thread Brent Baisley
Both times seem a bit long, even if you database has millions of rows. Can you post and explain of your query? That they are in different databases should have minimal effect on your query. Brent On Oct 3, 2008, at 12:14 PM, mos wrote: I have two indexed MyISAM tables, each in a separate

Re: [PHP] joins issues again

2008-04-08 Thread Daniel Brown
the count of records from sales. Can someone assist me with this? I have tried differance variants of joins and none of the results are correct. Sales tbl doesnt have the companyID, nor does IGuser Steven, Since this isn't a PHP-specific question, you'll probably receive better

Re: performance of heterogeneous joins

2008-01-25 Thread Alex K
Cool it's good to know thank you. On 25/01/2008, Jay Pipes [EMAIL PROTECTED] wrote: Nope, no difference, AFAIK. Alex K wrote: Any ideas pertaining this newbie question? Thank you so much, Hi Guys, Is there a performance hit when joining across multiple databases as opposed to

Re: performance of heterogeneous joins

2008-01-24 Thread Alex K
Any ideas pertaining this newbie question? Thank you so much, Hi Guys, Is there a performance hit when joining across multiple databases as opposed to joining multiples tables in one database? Suppose the same tables are available across all databases. Thank you, Alex -- MySQL

Re: performance of heterogeneous joins

2008-01-24 Thread Jay Pipes
Nope, no difference, AFAIK. Alex K wrote: Any ideas pertaining this newbie question? Thank you so much, Hi Guys, Is there a performance hit when joining across multiple databases as opposed to joining multiples tables in one database? Suppose the same tables are available across all

Help with MySQL Query (2 Outer joins)

2008-01-23 Thread Raghuveer Rawat
Hi, I need some urgent for sql query.. It will be great if someone could help me.. I have ARTICLE, FAVORITE_ARTICLES, RATING Tables apart from other table USER, CHANNEL, CATEGORY etc ARTICLE table stores a user's article, FAVORITE_ARTICLES will store a user's favorite articles, and rating

performance of heterogeneous joins

2008-01-19 Thread Alex K
Hi Guys, Is there a performance hit when joining across multiple databases as opposed to joining multiples tables in one database? Suppose the same tables are available across all databases. Thank you, Alex -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Assistance with query and joins

2007-12-12 Thread Erich C. Beyrent
Hi all, I have a query that is not quite producing what I expected: select n.nid, n.title, DATE_FORMAT(FROM_UNIXTIME(n.created), '%c/%e/%Y') as created, c.field_product_price_value as price, d.name, t.tid, v.value AS vote_average from node n left join

Cross database joins

2007-11-26 Thread Eric Frazier
Hi, I found one thread on this that included some people's opinions, but I haven't been able to find anyone who has actually done some performance testing to see if there is a cost and what that cost is to doing cross database joins. I do tend to want to keep everything in one DB

Left outer joins, where clause and table_names

2007-10-24 Thread tom wang
Hi, I have the following sql request: SELECT projects.`id` AS t0_r0, projects.`name` AS t0_r1, projects.`abbreviated_name` AS t0_r2, projects.`producer` AS t0_r3, projects.`tel_1` AS t0_r4, projects.`tel_2` AS t0_r5, projects.`recital` AS t0_r6, projects.`completed_flag` AS t0_r7,

Re: Left outer joins, where clause and table_names

2007-10-24 Thread mysql
tom wang wrote: Hi, I have the following sql request: [snipped, for the sake of the children] As you can see I have two left outerjoins involving the readerships table: LEFT OUTER JOIN readerships ON readerships.topic_id = topics.id and LEFT OUTER JOIN readerships readerships_topics ON

OT: K.I.S.S.? Re: Left outer joins, where clause and table_names

2007-10-24 Thread Ralf Hüsing
tom wang schrieb: Hi, I have the following sql request: SELECT projects.`id` AS t0_r0, projects.`name` AS [..endless sql..] Hi Tom, did you understand that query (in lets say 3 months) if you need to fix a bug? If not it maybe better to simplify that. regards -ralf -- MySQL General

RE : Re: Left outer joins, where clause and table_names

2007-10-24 Thread tom wang
Hi, First, sorry, I kind of messed of with copy and pasting (it's been a long day) and forgot to strip all the useless part (for the sake of explaining my problem) between select and from... SELECT * FROM projects LEFT OUTER JOIN forums ON forums.work_id = projects.id AND forums.work_type =

Re: RE : Re: Left outer joins, where clause and table_names

2007-10-24 Thread mysql
tom wang wrote: Hi, First, sorry, I kind of messed of with copy and pasting (it's been a long day) and forgot to strip all the useless part (for the sake of explaining my problem) between select and from... SELECT * FROM projects LEFT OUTER JOIN forums ON forums.work_id = projects.id AND

RE : Re: RE : Re: Left outer joins, where clause and table_names

2007-10-24 Thread tom wang
--- [EMAIL PROTECTED] a écrit : tom wang wrote: Hi, First, sorry, I kind of messed of with copy and pasting (it's been a long day) and forgot to strip all the useless part (for the sake of explaining my problem) between select and from... SELECT * FROM projects LEFT

Multi Lookup Table Joins

2007-09-30 Thread Chris W
more than one that syntax wont work because the second join will be trying to join to the first lookup table no the main table. Is there a way around this or do I need to just do joins using this syntax SELECT x, y, z FROM table t, lookupA la, lookupB lb WHERE t.aID = a.aID AND t.bID = b.bID

Re: Multi Lookup Table Joins

2007-09-30 Thread Baron Schwartz
need to join more than one that syntax wont work because the second join will be trying to join to the first lookup table no the main table. Is there a way around this or do I need to just do joins using this syntax SELECT x, y, z FROM table t, lookupA la, lookupB lb WHERE t.aID = a.aID

Re: Multi Lookup Table Joins

2007-09-30 Thread Rob Wultsch
join will be trying to join to the first lookup table no the main table. Is there a way around this or do I need to just do joins using this syntax SELECT x, y, z FROM table t, lookupA la, lookupB lb WHERE t.aID = a.aID AND t.bID = b.bID -- Chris W KE5GIX Protect your digital freedom

Performance Problems With JOINS - Tunnng required or upgrade hardware?

2007-09-14 Thread [ Triadbrasil ] Filipe Tomita
Hi all, First sorry my bad english :) I having a problem with a large join with 10 tables with 70Gb of text data, some joins executed by index but some others not. I´m work with HP SERVER (Proliant NL-150) a 2 Xeon 2 Duo with 3Gb Ram and RAID 0. When executed to a client with small datasets

Re: Performance Problems With JOINS - Tunnng required or upgrade hardware?

2007-09-14 Thread Baron Schwartz
and include the output of SHOW CREATE TABLE for the tables, your query, and the result of EXPLAIN for the query. [ Triadbrasil ] Filipe Tomita wrote: Hi all, First sorry my bad english :) I having a problem with a large join with 10 tables with 70Gb of text data, some joins executed by index but some

How to rewrite SQL query for new MySQL LEFT JOINS

2007-05-23 Thread Gmail User
I hope someone can clue me in what a syntax of query that produces the same would look like for MySQL 5.0.12 Old query meant to list most recent message from each thread, e.g. select * from messages left join messages as messages_ on messages.thread = messages_.thread and messages.created

Re: How to rewrite SQL query for new MySQL LEFT JOINS

2007-05-23 Thread Gmail User
It worked in 4.x but does not work in the new syntax. How should I rewrite it to get the same result? OK, that was a lie. It works in 5.x as well. I should learn to describe my problem more accurately as well as RTFM :-( The correct description of the query in question would have been: select

Re: LEFT/RIGHT Joins not working

2007-04-04 Thread murthy gandikota
appreciate your help. Thanks Murthy Michael Dykman wrote: a left join and a right join are 2 very distinct things... It is not clear from your text what it is you exactly are going for here but I doubt that applying either LEFT or RIGHT to ALL of your (many) joins is going to give it to you

RE: Joins versus Grouping/Indexing: Normalization Excessive?

2007-04-03 Thread Jerry Schwartz
12:15 AM To: mysql@lists.mysql.com Subject: Joins versus Grouping/Indexing: Normalization Excessive? So I'm currently designing a database for a web site and intra net for my campuses student radio. Since I'm not getting paid for this and I'm doing this in my free time I kinda want to take my

LEFT/RIGHT Joins not working

2007-04-03 Thread murthy gandikota
I tried the following 2 SQL's and the results are less than satisfactory. The RIGHT join does not show where disposition is NULL. The LEFT join shows dispositions as NULL where they shouldn't be. Also the LEFT join generates more dupes. Any way to fix this? select cust.first as FIRST,

Re: LEFT/RIGHT Joins not working

2007-04-03 Thread Michael Dykman
a left join and a right join are 2 very distinct things... It is not clear from your text what it is you exactly are going for here but I doubt that applying either LEFT or RIGHT to ALL of your (many) joins is going to give it to you. You need to stop and examine the relationships between

Re: LEFT/RIGHT Joins not working

2007-04-03 Thread murthy gandikota
... It is not clear from your text what it is you exactly are going for here but I doubt that applying either LEFT or RIGHT to ALL of your (many) joins is going to give it to you. You need to stop and examine the relationships between the tables in this query and determine which class of JOIN you

Re: LEFT/RIGHT Joins not working

2007-04-03 Thread Mogens Melander
[EMAIL PROTECTED] wrote: a left join and a right join are 2 very distinct things... It is not clear from your text what it is you exactly are going for here but I doubt that applying either LEFT or RIGHT to ALL of your (many) joins is going to give it to you. You need to stop and examine

Joins versus Grouping/Indexing: Normalization Excessive?

2007-04-02 Thread Daniel Cousineau
So I'm currently designing a database for a web site and intra net for my campuses student radio. Since I'm not getting paid for this and I'm doing this in my free time I kinda want to take my time and have the system setup as perfectly as any one college student can. I'm currently debating on

Re: Joins versus Grouping/Indexing: Normalization Excessive?

2007-04-02 Thread Micah Stevens
I think you're approaching this from the wrong angle. You'll want to put the data at the highest level at which it changes. i.e. If every song on an album is always the same year, put it at the album level, however, if it changes from song to song on a particular album, then you want it at

mysql 4.11, left joins, multiple tables

2007-03-12 Thread Andrew Wallace
Hi - I'm having an issue with left joins and multiple tables. I have a table which is a fairly simple name-value pair table: create table { acnt char(20), item char(40), value char (60) } I want to pull out all of a subset of the values for a particular account. It works for two

Joins with sums

2007-01-30 Thread webmaster
I'm missing something really silly in a query. I want to produce a list of accounts, the invoices and receipts and the balance against them. Simply, there is an accounts table, invoices and receipts. I want to show the account details, sum(invoices), sum(receipts) and the balance. There is a

Re: Joins with sums

2007-01-30 Thread Brent Baisley
You're left joining invoices, then left joining receipts. A left join will replicate rows on the left side to match the number of rows it found in the join, or just leave 1 row with NULL values (as you probably know). This is where your problem is. You were correct to try to use left joins

A simple way to make table joins 2x faster

2006-11-27 Thread mos
I thought I'd pass this on for those of you that have slow table joins. I'm sure a few of you have already figured this out, but if not, here it is. I have some slow table joins, namely a 6 table join using a primary integer index field which takes 15 seconds to pull in 18k rows from each

When are subselects faster than Joins?

2006-11-06 Thread Robert DiFalco
Are there any hard and fast rules for this? If someone has already compiled a list I'd love to see it. For example: * When a subselect will eliminate duplicates a join might introduce. Change: SELECT DISTINCT Acl.* FROM Acl JOIN Link ON Link.childID = Acl.ID JOIN Paths ON

Re: Complex SQL for multiple joins

2006-08-31 Thread Brent Baisley
Subject: Complex SQL for multiple joins Hi, For my current website project I'm developing a fine-grained access control system. I have the schema mostly worked out, although it will be having additional data added to parts of it later. For the record, I have 6 tables: users (contains all my

Re: Complex SQL for multiple joins

2006-08-31 Thread Jay Pipes
for multiple joins Hi, For my current website project I'm developing a fine-grained access control system. I have the schema mostly worked out, although it will be having additional data added to parts of it later. For the record, I have 6 tables: users (contains all my individual users

RE: Complex SQL for multiple joins

2006-08-31 Thread Robert DiFalco
; mysql@lists.mysql.com Subject: Re: Complex SQL for multiple joins Also, depending on the number of permissions you are tracking, you could use a single INT field and do bitwise ORing in your application to determine permission checks... Though I usually don't recommend denormalizing the schema

Complex SQL for multiple joins

2006-08-30 Thread Stephen Orr
Hi, For my current website project I'm developing a fine-grained access control system. I have the schema mostly worked out, although it will be having additional data added to parts of it later. For the record, I have 6 tables: users (contains all my individual users) usergroups (contains all

Re: Should Joins always be using an index? (where possible?)

2006-08-20 Thread chris smith
On 8/20/06, Ow Mun Heng [EMAIL PROTECTED] wrote: I'm have a query like so select A, index_A from tableA join tableB on tableB.indexA = tableA.indexA select A, index_A from tableA join tableB on tableB.A = tableA.A whcih would be more efficient? using the where clause which uses the index or

Re: Should Joins always be using an index? (where possible?)

2006-08-20 Thread Ow Mun Heng
On Sun, 2006-08-20 at 19:59 +1000, chris smith wrote: On 8/20/06, Ow Mun Heng [EMAIL PROTECTED] wrote: I'm have a query like so select A, index_A from tableA join tableB on tableB.indexA = tableA.indexA select A, index_A from tableA join tableB on tableB.A =

Re: Should Joins always be using an index? (where possible?)

2006-08-20 Thread Chris
Ow Mun Heng wrote: On Sun, 2006-08-20 at 19:59 +1000, chris smith wrote: On 8/20/06, Ow Mun Heng [EMAIL PROTECTED] wrote: I'm have a query like so select A, index_A from tableA join tableB on tableB.indexA = tableA.indexA select A, index_A from tableA join tableB on tableB.A = tableA.A

[SOLVED] Re: Should Joins always be using an index? (where possible?)

2006-08-20 Thread Ow Mun Heng
On Mon, 2006-08-21 at 07:39 +1000, Chris wrote: Ow Mun Heng wrote: On Sun, 2006-08-20 at 19:59 +1000, chris smith wrote: On 8/20/06, Ow Mun Heng [EMAIL PROTECTED] wrote: I'm have a query like so select A, index_A from tableA join tableB on tableB.indexA = tableA.indexA

Should Joins always be using an index? (where possible?)

2006-08-19 Thread Ow Mun Heng
I'm have a query like so select A, index_A from tableA join tableB on tableB.indexA = tableA.indexA select A, index_A from tableA join tableB on tableB.A = tableA.A whcih would be more efficient? using the where clause which uses the index or the one which isn't index? -- MySQL General

Re: inner outer joins

2006-08-10 Thread Chris
Brian E Boothe wrote: hi all Can someone provide a small project using inner and outter joins with querys thanks alot create table t1 (id int); create table t2 (id int); This will find everything that has an entry in both tables: select * from t1 inner join t2; This will find records

inner outer joins

2006-08-09 Thread Brian E Boothe
hi all Can someone provide a small project using inner and outter joins with querys thanks alot -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Multiple joins

2006-06-30 Thread Steffan A. Cline
joins like this? Thanks Steffan --- T E L 6 0 2 . 5 7 9 . 4 2 3 0 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 Steffan A. Cline [EMAIL PROTECTED] Phoenix, Az http://www.ExecuChoice.net

Re: Multiple joins

2006-06-30 Thread Gerald L. Clark
; Is it legal to do multiple joins like this? Thanks Steffan forum_messages does not take part in any selection or any where clause. You have 5 tables listed, with only 4 of them appearing in 2 disjointed, and improperly formed joins. From the comma separated table list after a LEFT JOIN, I

Re: Multiple joins

2006-06-30 Thread Steffan A. Cline
A. Cline [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: Multiple joins Steffan A. Cline wrote: What am I missing here? select m.*, d.discussion, d.discussion_id, u.user_id, t.topic_id from forums_messages left join forums_members m, forums_discussions d, users u, forums_topics t

  1   2   3   4   5   6   >