<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel>
	  <title>Ask MetaFilter questions tagged with join</title>
      <link>http://ask.metafilter.com/tags/join</link>
      <description>Questions tagged with 'join' at Ask MetaFilter.</description>
	  <pubDate>Sat, 12 Sep 2009 19:07:01 -0800</pubDate> <lastBuildDate>Sat, 12 Sep 2009 19:07:01 -0800</lastBuildDate>

      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>	  
	<item>
	<title>How to merge multiple text files keeping original filename and date</title>
	<link>http://ask.metafilter.com/132691/How%2Dto%2Dmerge%2Dmultiple%2Dtext%2Dfiles%2Dkeeping%2Doriginal%2Dfilename%2Dand%2Ddate</link>	
	<description>Hi AskMeFi. Can someone tell me how to combine 350 text files into one large text file so that the &lt;strong&gt;original filenames and dates&lt;/strong&gt; are included above (or below) each entry?  I&apos;m using Vista Home Premium and they are all generic .txt files. I&apos;m moving all of my notes into Evernote but want to save the names and dates of the individual txt files.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.132691</guid>
	<pubDate>Sat, 12 Sep 2009 19:07:01 -0800</pubDate>
	<category>batch</category>
	<category>combine</category>
	<category>concatenate</category>
	<category>datestamp</category>
	<category>dos</category>
	<category>evernote</category>
	<category>filename</category>
	<category>files</category>
	<category>header</category>
	<category>join</category>
	<category>merge</category>
	<category>script</category>
	<category>text</category>
	<category>utility</category>
	<category>vista</category>
	<category>windows</category>
	<dc:creator>chimrichalds</dc:creator>
	</item>
	<item>
	<title>Joining MP3 Files Together Based on Date in Filename?</title>
	<link>http://ask.metafilter.com/117747/Joining%2DMP3%2DFiles%2DTogether%2DBased%2Don%2DDate%2Din%2DFilename</link>	
	<description>I have a podcast that downloads as multiple segments over multiple days.  Its format arrives as YYYYMMDD_showcode_segment.mp3; so, for example, one download might result in files as 20090323_goofa_01.mp3 through 20090323_goofa_21.mp3, and also &lt;i&gt;within the same download&lt;/i&gt; 20090324_goofa_01.mp3 through 20090324_goofa_21.mp3.  What I&apos;m looking for is a Unix script (shell, perl, what have you) that would look at a directory and look at what dates are represented there, and let me join all of the segments together by day.  I can use mpgtx -j to do the actual joining; I&apos;m looking for the code that would let the script determine what dates are in the directory and then get each day&apos;s segments united into a single MP3 for that day&apos;s show.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.117747</guid>
	<pubDate>Wed, 25 Mar 2009 16:08:55 -0800</pubDate>
	<category>bash</category>
	<category>csh</category>
	<category>day</category>
	<category>group</category>
	<category>join</category>
	<category>mp3</category>
	<category>perl</category>
	<category>resolved</category>
	<category>script</category>
	<category>segment</category>
	<category>tcsh</category>
	<category>unix</category>
	<dc:creator>WCityMike</dc:creator>
	</item>
	<item>
	<title>Doing JOINs the Rails way</title>
	<link>http://ask.metafilter.com/89184/Doing%2DJOINs%2Dthe%2DRails%2Dway</link>	
	<description>How can I do a Rails &lt;code&gt;find&lt;/code&gt; JOIN without SQL, using the two tables&apos; existing &lt;code&gt;has_and_belongs_to_many&lt;/code&gt; relationships? I have two classes &lt;code&gt;Sample&lt;/code&gt; and &lt;code&gt;User&lt;/code&gt;, which have:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;has_and_belongs_to_many :users, :uniq =&amp;gt; true&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
&lt;code&gt;has_and_belongs_to_many :samples, :uniq =&amp;gt; true&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
relationships in their respective model files. This sets up the many-to-many relationship between the two classes.&lt;br&gt;
&lt;br&gt;
Let&apos;s say I want to associate a Sample instance with a User instance:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;Sample.find_by_id(params[:sample][:id]).users &amp;lt;&amp;lt; User.find_by_id(params[:user_id])&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
So far so good.&lt;br&gt;
&lt;br&gt;
But I&apos;d like to avoid duplicates of a combination of &lt;code&gt;sample_id&lt;/code&gt; and &lt;code&gt;user_id&lt;/code&gt;.&lt;br&gt;
&lt;br&gt;
Therefore, I&apos;d like to search on &lt;code&gt;samples_users&lt;/code&gt; to find a previously-entered record which matches those two &lt;code&gt;id&lt;/code&gt; numbers.&lt;br&gt;
&lt;br&gt;
I could do this with a SQL JOIN but I&apos;d like to learn the Rails way, so that I don&apos;t have to write custom SQL that will likely break during development.&lt;br&gt;
&lt;br&gt;
How to I use the &lt;code&gt;find&lt;/code&gt; method on &lt;code&gt;Sample&lt;/code&gt; to get any matches with a specified &lt;code&gt;sample_id&lt;/code&gt; and &lt;code&gt;user_id&lt;/code&gt;?&lt;/code&gt;&lt;/&gt;</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.89184</guid>
	<pubDate>Fri, 18 Apr 2008 13:37:40 -0800</pubDate>
	<category>activerecord</category>
	<category>join</category>
	<category>rails</category>
	<category>ruby</category>
	<category>sql</category>
	<dc:creator>Blazecock Pileon</dc:creator>
	</item>
	<item>
	<title>What is the right combination of joins and select statements to get this information from a mysql database?</title>
	<link>http://ask.metafilter.com/84566/What%2Dis%2Dthe%2Dright%2Dcombination%2Dof%2Djoins%2Dand%2Dselect%2Dstatements%2Dto%2Dget%2Dthis%2Dinformation%2Dfrom%2Da%2Dmysql%2Ddatabase</link>	
	<description>MYSQL newbie needs some help with a crazy query! (Joins, foreign keys, and bears &quot;oh my!&quot;) Hallo, all.  So I&apos;m just starting to get the hang on writing mysql queries with JOINS, but I&apos;m having the most difficult time with what I believe is a rather simple query.  I&apos;m wondering if someone here can help me out.  I&apos;ve got a rather complicated database of customers with a whole bunch of related tables and foreign keys.  (MYSQL structure is pasted below)&lt;br&gt;
&lt;br&gt;
Basically, I need to write a query that will a output all customers with the appropriate labels replacing the ugly &quot;foreign keys&quot; that are in there.  I&apos;ve been screwing around with joins for the better part of two days but I just can&apos;t wrap my mind around what should be (I think) a very simple query.  Something akin to:&lt;br&gt;
&lt;br&gt;
first_name | last_name | email | gender | customer_types.description | city | states.abbrev | zip | countries.name | ethnic_backgrounds.name | interest.interest_title(1) | interest.interest_title(2) | interest.interest_title(2) | inquiry_sources.sourcename&lt;br&gt;
&lt;br&gt;
Can any query wizards out there lend this newbie a hand?&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
&lt;br&gt;
CREATE TABLE `customers` (&lt;br&gt;
  `id` int(10) unsigned NOT NULL auto_increment,&lt;br&gt;
  `first_name` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  `last_name` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  `email` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  `gender` varchar(10) NOT NULL default &apos;&apos;,&lt;br&gt;
  `customer_type_id` int(10) unsigned NOT NULL default &apos;0&apos;,&lt;br&gt;
  `city` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  `state_id` int(10) unsigned NOT NULL default &apos;0&apos;,&lt;br&gt;
  `zip` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  `country_id` int(10) NOT NULL default &apos;0&apos;,&lt;br&gt;
  `ethnic_background_id` int(10) unsigned NOT NULL default &apos;0&apos;,&lt;br&gt;
  `interest1_id` int(10) unsigned NOT NULL default &apos;0&apos;,&lt;br&gt;
  `interest2_id` int(10) unsigned NOT NULL default &apos;0&apos;,&lt;br&gt;
  `interest3_id` int(10) unsigned NOT NULL default &apos;0&apos;,&lt;br&gt;
  `inquiry_source_id` int(10) unsigned NOT NULL default &apos;0&apos;&lt;br&gt;
  PRIMARY KEY  (`id`)&lt;br&gt;
)&lt;br&gt;
&lt;br&gt;
CREATE TABLE `customer_types` (&lt;br&gt;
  `id` int(10) unsigned NOT NULL auto_increment,&lt;br&gt;
  `description` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  PRIMARY KEY  (`id`)&lt;br&gt;
)&lt;br&gt;
&lt;br&gt;
CREATE TABLE `states` (&lt;br&gt;
  `id` int(10) unsigned NOT NULL auto_increment,&lt;br&gt;
  `name` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  `abbrev` varchar(4) NOT NULL default &apos;&apos;,&lt;br&gt;
  PRIMARY KEY  (`id`)&lt;br&gt;
) TYPE=MyISAM AUTO_INCREMENT=67 ;&lt;br&gt;
&lt;br&gt;
CREATE TABLE `countries` (&lt;br&gt;
  `id` int(11) NOT NULL auto_increment,&lt;br&gt;
  `name` varchar(100) NOT NULL default &apos;&apos;,&lt;br&gt;
  PRIMARY KEY  (`id`)&lt;br&gt;
)&lt;br&gt;
&lt;br&gt;
CREATE TABLE `ethnic_backgrounds` (&lt;br&gt;
  `id` int(10) unsigned NOT NULL auto_increment,&lt;br&gt;
  `name` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  PRIMARY KEY  (`id`)&lt;br&gt;
) &lt;br&gt;
&lt;br&gt;
TABLE `interests` (&lt;br&gt;
  `Record_id` int(11) NOT NULL auto_increment,&lt;br&gt;
  `interest_title` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  PRIMARY KEY  (`Record_id`)&lt;br&gt;
)&lt;br&gt;
&lt;br&gt;
CREATE TABLE `inquiry_sources` (&lt;br&gt;
  `id` int(10) unsigned NOT NULL auto_increment,&lt;br&gt;
  `sourcename` varchar(255) NOT NULL default &apos;&apos;,&lt;br&gt;
  PRIMARY KEY  (`id`)&lt;br&gt;
) &lt;br&gt;
&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
Thanks in advance for any help.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.84566</guid>
	<pubDate>Mon, 25 Feb 2008 10:39:18 -0800</pubDate>
	<category>foreignkeys</category>
	<category>join</category>
	<category>mysql</category>
	<category>query</category>
	<category>select</category>
	<dc:creator>lucidreamstate</dc:creator>
	</item>
	<item>
	<title>Best way to rip movie video to 1 stream</title>
	<link>http://ask.metafilter.com/72531/Best%2Dway%2Dto%2Drip%2Dmovie%2Dvideo%2Dto%2D1%2Dstream</link>	
	<description>I want to rip a movie from a DVD to its elementary streams (.ac3 &amp;amp; .m2v). I can do this using the Stream Processing\Demux option in DVD Decrypter, but because the video is spread across several VOBs, I end up with several video files. So - I then have to rejoin these video segments, which I&apos;m using the Join command in DOS for. It works fine but I&apos;m wondering if there&apos;s an easier way to do this? I&apos;m open to Mac options too.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.72531</guid>
	<pubDate>Thu, 27 Sep 2007 11:06:06 -0800</pubDate>
	<category>ac3</category>
	<category>dvd</category>
	<category>elementarystreams</category>
	<category>join</category>
	<category>m2v</category>
	<category>rip</category>
	<dc:creator>The_Partridge_Family</dc:creator>
	</item>
	<item>
	<title>This sql query should be simple...</title>
	<link>http://ask.metafilter.com/68451/This%2Dsql%2Dquery%2Dshould%2Dbe%2Dsimple</link>	
	<description>I&apos;m trying to merge simple contact data from a bunch of single tables into one big text (csv) dump. The problem is that not all fields are present for each user. e.g. one user may be missing an email. Because of the missing field, my current (big and ugly) sql query will not return all the rows.
This seems like a simple problem, but I&apos;m stuck. Help!&lt;br&gt;
&lt;br&gt;
Here&apos;s a simplified version of what I&apos;ve got:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
table: users&lt;br&gt;
columns: uid, username&lt;br&gt;
data: 1, bill&lt;br&gt;
data: 2, joe&lt;br&gt;
&lt;br&gt;
table: profile_fields&lt;br&gt;
columns: fid, name&lt;br&gt;
data: 1, Phone&lt;br&gt;
data: 2, email&lt;br&gt;
&lt;br&gt;
table: profile_values&lt;br&gt;
columns: uid, fid, value&lt;br&gt;
data: 1, 1, 555-1212&lt;br&gt;
data: 2, 1, 999-0000&lt;br&gt;
data: 2, 2, foo@foo.com&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
What I want my query to output:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;&lt;br&gt;
uid, username, phone, email&lt;br&gt;
1, bill, 555-1212,&lt;br&gt;
2, joe, 999-0000, foo@foo.com&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
(notice there is no email for uid 1)&lt;br&gt;
&lt;br&gt;
What is the sql to do this? btw, i&apos;m using mysql.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.68451</guid>
	<pubDate>Thu, 02 Aug 2007 21:41:41 -0800</pubDate>
	<category>join</category>
	<category>mysql</category>
	<category>sql</category>
	<dc:creator>kamelhoecker</dc:creator>
	</item>
	<item>
	<title>Joining MP3s</title>
	<link>http://ask.metafilter.com/67314/Joining%2DMP3s</link>	
	<description>How can I join multiple MP3s into one? I have a couple of Librivox books that I want to join as one huge MP3 file for my player. How can I do this using either freeware or FOSS?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.67314</guid>
	<pubDate>Wed, 18 Jul 2007 22:29:44 -0800</pubDate>
	<category>join</category>
	<category>mp3</category>
	<dc:creator>enriquem</dc:creator>
	</item>
	<item>
	<title>What&apos;s the easiest way to join MPEG-2 segments?</title>
	<link>http://ask.metafilter.com/47883/Whats%2Dthe%2Deasiest%2Dway%2Dto%2Djoin%2DMPEG2%2Dsegments</link>	
	<description>I have a set of about two dozen DVD-ready MPEG-2 files that I&apos;d like to combine into one file without re-encoding.  What&apos;s the easiest way to do this?  I can do under XP or OS X, but XP is preferred. I am using Sony DVD Architect to build the DVD itself, and it seems that joining separate MPEGs into one title is the only thing it won&apos;t do.  The MPEGs were created using AviSynth, which craps out if I try to combine them in the source, so it seems I can only do it after the fact.  If I Google for MPEG joining software, I get tons of results that all look similarly dodgy.  As I said, Mac or Windows is fine, but the Mac is a MacBook and the Windows machine is a Dell desktop with about twice the processor and RAM, so I&apos;d rather use the latter.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.47883</guid>
	<pubDate>Wed, 04 Oct 2006 09:25:02 -0800</pubDate>
	<category>dvd</category>
	<category>join</category>
	<category>mpeg</category>
	<category>mpeg-2</category>
	<category>segment</category>
	<dc:creator>aaronetc</dc:creator>
	</item>
	<item>
	<title>Je voudrais jouer au football (je suis une fille)</title>
	<link>http://ask.metafilter.com/37676/Je%2Dvoudrais%2Djouer%2Dau%2Dfootball%2Dje%2Dsuis%2Dune%2Dfille</link>	
	<description>I&apos;m going on a six month exchange to Lyon, France, in August and I&apos;d like to play football (soccer) while I&apos;m over there. I can play at a reasonable level, and I&apos;d be in open womens agewise. Ideally I&apos;d play through university (Lumiere) or in a club with a similar group of people, but I&apos;m having trouble finding specific club information online.  I can play at a reasonable level, and I&apos;d be in open womens. Ideally I&apos;d play through university or in a club with a similar group, and one with several teams so I&apos;d have a chance of fitting in well somewhere, but I&apos;m having trouble finding specific club information online, and also season dates. I&apos;ve been to fff.fr, but found it difficult to navigate.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.37676</guid>
	<pubDate>Sat, 06 May 2006 11:29:25 -0800</pubDate>
	<category>football</category>
	<category>france</category>
	<category>join</category>
	<category>lyon</category>
	<category>team</category>
	<dc:creator>jacalata</dc:creator>
	</item>
	
	</channel>
</rss>

