Hi all,
I have a table in SQL SERVER
SERVER IP
web1 10.169.23.12
web1 10.169.25.25
web2 10.169.24.15
....
I want to list the First SERVER and IP
The result must be
SERVER IP
web1 10.169.23.12
web2 10.169.24.15
...
I'm not a confirmed user of SQL
I have try this, but it don't work.
select SERVER, IP from TABLE group by SERVER;
How can i do this ?
Thank's in advance for your help.
--
Salutations
Yvan> I want to list the First SERVER and IP
So what do you mean by "first"? You need to put a DATETIME column into your
table if you want to record the order in which the rows were inserted, or
some other column to define the sequence - tables have no inherent ordering.
If you can make do with any value of IP:
SELECT server, MIN(ip) AS ip
FROM Table GROUP BY server;
--
David Portas
--
Please reply only to the newsgroup
--
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment