Query syntax help - Select 1 from multiple rows
Posted in 2000
Topics: General Discussion
I need help: Table A: Cust_no Table B: Cust_no Cust_name Table B can contain duplicated cust_no's, each with an alternate name for the customer How can I select ONLY 1 record from table B using a cust_no from table A ? Any help is greatly appreciated. Thanks PN
just a quick idea... I haven't tested or anything but what about...
select Cust_no, min(Cust_name)
group by Cust_no......
PN wrote:
> I need help:
> Table A:
> Cust_no
>
> Table B:
> Cust_no
> Cust_name
>
> Table B can contain duplicated cust_no's, each with an alternate name for
> the customer
> How can I select ONLY 1 record from table B using a cust_no from table A ?
> Any help is greatly appreciated.
> Thanks
> PN
--
Madison Pruet
===========================================
Enterprise Replication Product Developement
Dallas, Texas
Informix Software
===========================================
Thank you all for your response. I'll try all!
PN
"Madison Pruet" <mpruet@informix.com> wrote in message
news:38BDD448.8A0089D2@informix.com...
> just a quick idea... I haven't tested or anything but what about...
>
> select Cust_no, min(Cust_name)
> group by Cust_no......>
>
> PN wrote:
>
> > I need help:
> > Table A:
> > Cust_no
> >
> > Table B:
> > Cust_no
> > Cust_name
> >
> > Table B can contain duplicated cust_no's, each with an alternate name
for
> > the customer
> > How can I select ONLY 1 record from table B using a cust_no from table A
?
> > Any help is greatly appreciated.
> > Thanks
> > PN
>
> --
> Madison Pruet
>
> ===========================================
> Enterprise Replication Product Developement
> Dallas, Texas
> Informix Software
> ===========================================
>
>