Re: Using Joins/Unions

2015-08-04 Thread Ryan Coleman
No but there should be. If there's not my task is useless. 

Secondly yes. Unique name on it too. 

--
Ryan Coleman
Publisher, d3photography.com
ryan.cole...@cwis.biz
m. 651.373.5015
o. 612.568.2749

 On Aug 4, 2015, at 17:33, 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 two tables, one with Unique data (“images”) and one with
 corresponding paths but many replicated records (“files”).
 
 I want to run a query that takes the results from /images/ and also
 searches /images.file/ as a LIKE statement from /files.path/, sort by
 /files.filesize/ in descending order returning just the first record
 (largest file size).  There may be up to 750 records from /images/ and
 thusly could be 3000+ from /files/.
 
 How on earth do I do this?
 
 —
 Ryan
 First question, will there always be at least one record in the files
 table for every record in the images table?  That controls the kind of
 join you will use.  I don't think that a union is a player. Also, is there
 a unique record ID in each of the table?
 --
 William R. Mussatto
 Systems Engineer
 http://www.csz.com
 909-920-9154
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql
 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



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 
paths but many replicated records (“files”).

I want to run a query that takes the results from /images/ and also searches 
/images.file/ as a LIKE statement from /files.path/, sort by /files.filesize/ 
in descending order returning just the first record (largest file size).  There 
may be up to 750 records from /images/ and thusly could be 3000+ from /files/.

How on earth do I do this?

—
Ryan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



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 with Unique data (“images”) and one with
 corresponding paths but many replicated records (“files”).

 I want to run a query that takes the results from /images/ and also
 searches /images.file/ as a LIKE statement from /files.path/, sort by
 /files.filesize/ in descending order returning just the first record
 (largest file size).  There may be up to 750 records from /images/ and
 thusly could be 3000+ from /files/.

 How on earth do I do this?

 —
 Ryan
First question, will there always be at least one record in the files
table for every record in the images table?  That controls the kind of
join you will use.  I don't think that a union is a player. Also, is there
a unique record ID in each of the table?
--
William R. Mussatto
Systems Engineer
http://www.csz.com
909-920-9154


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql