|
|
Choosing A Webhost: |
Re: join problem or maybe group :(: msg#01162db.postgresql.general
hmmm, me again. Ill attack the subject from another way. Can i limit the left joined table to one result ? like: select * from table1 left join table2 using (column) limit table2 1,0; ? > Hi All > > > I want to select sections using left join on articles, but i want to retrive > only one row from articles per section and the one should be the latest > art_date. > > Can it be done ? > > CREATE TABLE sections ( > sec_id SERIAL PRIMARY KEY, > sec_name VARCHAR (30), > sec_order INT2 > ); > > > CREATE TABLE articles ( > art_id SERIAL PRIMARY KEY, > sec_id INT4 REFERENCES sections ON UPDATE CASCADE ON DELETE CASCADE, > art_name VARCHAR (30), > art_date DATE > ); > > Cheer > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: rules and functions as arguments, Tom Lane |
|---|---|
| Next by Date: | Re: join problem or maybe group :(, Stephan Szabo |
| Previous by Thread: | join problem or maybe group :(, Ben-Nes Michael |
| Next by Thread: | Re: join problem or maybe group :(, Stephan Szabo |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |