Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #682
| From | Chris Riesbeck <Chris.Riesbeck@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.databases |
| Subject | Re: joining |
| Date | 2014-08-08 11:55 -0500 |
| Message-ID | <c4kdkrF2fanU1@mid.individual.net> (permalink) |
| References | <jve9u9d3vao1hvitvdmslkeec7sn7duv4o@4ax.com> <q565h9mt8b3f$.dlg@kimmeringer.de> |
On 8/8/2014 8:54 AM, Lothar Kimmeringer wrote: > Roedy Green wrote: > >> I suspect it might be faster/better to get SQL to join the records for >> me and present me with one unified record. > > If you mean resultset when speaking of record, it is. > >> Is that a better approach and if so, what does a query look like given >> each record has a unique integer key? > > Not sure, where the java-related question is, but the statement > would look like this: > > > select a.name, b.quote from authors a, quotes b > where a.id = b.id_author Or, select a.name, b.quote from authors a join quotes b on a.id = b.id_author I prefer using JOIN for joins and WHERE clauses for other constraints. Also makes it easier to modify the type of JOIN if that becomes an issue.
Back to comp.lang.java.databases | Previous | Next — Previous in thread | Next in thread | Find similar
joining Roedy Green <see_website@mindprod.com.invalid> - 2014-08-08 05:04 -0700
Re: joining Lothar Kimmeringer <news200709@kimmeringer.de> - 2014-08-08 15:54 +0200
Re: joining Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2014-08-08 11:55 -0500
Re: joining Roedy Green <see_website@mindprod.com.invalid> - 2014-08-08 19:19 -0700
Re: joining Silvio <silvio@internet.com> - 2014-08-09 07:06 +0200
Re: joining Roedy Green <see_website@mindprod.com.invalid> - 2014-08-09 02:45 -0700
Re: joining Silvio <silvio@internet.com> - 2014-08-09 12:16 +0200
Re: joining Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2014-08-11 12:23 -0500
csiph-web