Re: special join
Jan Novak <[email protected]> Mon, 7 Sep 2020 14:54:51 +0200
| Newsgroups | comp.databases.mysql |
|---|---|
| Organization | MB-NET.NET for Open-News-Network e.V. |
| Message-ID | <[email protected]> |
Am 07.09.20 um 14:19 schrieb Jan Novak: > Am 07.09.20 um 14:15 schrieb The Natural Philosopher: >> On 07/09/2020 11:26, Jan Novak wrote: >>> Hi, >>> >>> i have a table "server" with auto_increment field ID and a table >>> "ip", with a filed "SERVER_ID" corrosponding to "server.ID" >>> >>> select ip.VALUE as "ip" from server, ip where server.DELETED=0 and >>> server.ID=ip.SERVER_ID >>> >>> If in "ip" table for the server are more then one ip adress are >>> saved, i get in my results the server also more then one time listed. >>> >>> My question is: how can i get only the server with the first IP from >>> the ip Table, if more then one ip's saved there. >>> >>> Jan >> >> order by....unique > > sorry, i dont understand. > What should be orderd abd unique set? (Sorry for my bad english) The complete sql string is like that (with additional Infos from "port" table): select port.VALUE as "port", ip.VALUE as "ip" from server, port, ip where server.DELETED=0 and server.ID=port.SERVER_ID and server.ID=ip.SERVER_ID In ip Table are for a host 4 rows, but i like to have for the host only the first one. Jan