pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Dummy question
3+ messages / 2 participants
[nested] [flat]

* Dummy question
@ 2007-03-22 19:43  Ezequias R. da Rocha <ezequias@fastcon.com.br>
  0 siblings, 1 reply; 3+ messages in thread

From: Ezequias R. da Rocha @ 2007-03-22 19:43 UTC (permalink / raw)
  To: pgsql-sql

Hi list,

I must use a select * from some table but i must do a join and it must 
be in the were clause.

I can't put select * from tabel1 as tb1, table2 as tb2
where tb2.id = 2
and tb1.fk_tb2ID = tb2.id

I don't would like to use this select statement because the select 
brings us both columns (all columns) of both tables.

ps: I don't want to put all fields names too.


Can someone tell me if there is any way to put on the select only the 
fields of my first table ?

Regards...

-- 
Atenciosamente
Ezequias Rodrigues da Rocha




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Dummy question
@ 2007-03-22 20:17  Joe <dev@freedomcircle.net>
  parent: Ezequias R. da Rocha <ezequias@fastcon.com.br>
  0 siblings, 1 reply; 3+ messages in thread

From: Joe @ 2007-03-22 20:17 UTC (permalink / raw)
  To: Ezequias R. da Rocha <ezequias@fastcon.com.br>; +Cc: pgsql-sql

Hi Ezequias,

On Thu, 2007-03-22 at 16:43 -0300, Ezequias R. da Rocha wrote:
> I must use a select * from some table but i must do a join and it must 
> be in the were clause.
> 
> I can't put select * from tabel1 as tb1, table2 as tb2
> where tb2.id = 2
> and tb1.fk_tb2ID = tb2.id

Try 

select tb1.* from tabel1 as tb1, table2 as tb2
where tb2.id = 2
and tb1.fk_tb2ID = tb2.id;

Joe




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Dummy question
@ 2007-03-22 20:26  Ezequias R. da Rocha <ezequias@fastcon.com.br>
  parent: Joe <dev@freedomcircle.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Ezequias R. da Rocha @ 2007-03-22 20:26 UTC (permalink / raw)
  To: Joe <dev@freedomcircle.net>; +Cc: pgsql-sql

Thank you very much Joe.

Ezequias
Joe escreveu:
> Hi Ezequias,
>
> On Thu, 2007-03-22 at 16:43 -0300, Ezequias R. da Rocha wrote:
>   
>> I must use a select * from some table but i must do a join and it must 
>> be in the were clause.
>>
>> I can't put select * from tabel1 as tb1, table2 as tb2
>> where tb2.id = 2
>> and tb1.fk_tb2ID = tb2.id
>>     
>
> Try 
>
> select tb1.* from tabel1 as tb1, table2 as tb2
> where tb2.id = 2
> and tb1.fk_tb2ID = tb2.id;
>
> Joe
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly
>
>   


-- 
Atenciosamente
Ezequias Rodrigues da Rocha




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-03-22 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-22 19:43 Dummy question Ezequias R. da Rocha <ezequias@fastcon.com.br>
2007-03-22 20:17 ` Joe <dev@freedomcircle.net>
2007-03-22 20:26   ` Ezequias R. da Rocha <ezequias@fastcon.com.br>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox