Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 select address

Author  Topic 

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2006-08-04 : 10:38:27
1A apple street
11 apple street
1B apple street


i want to select only the first address. how do i do it?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-08-04 : 10:39:16
[code]select top 1 address
from addresses
order by address[/code]


KH

Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2006-08-04 : 10:44:05
thanks

but, i dont want it that way.

how do i only select 1A and 1B addresses?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-08-04 : 10:48:20
then define what do you mean by "first address"


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-04 : 11:26:25
Where Address in ('All your Addresses')

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2006-08-04 : 13:03:28
1a
11
1b

how can i select only the rows that has alpha numeric values? like
rows
----
1a
1b

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-04 : 13:42:18
select * from table where address like '[0-9][a-z]%'


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-08-04 : 18:16:19
SELECT * FROM myTable99 WHERE ISNUMERIC(address) = 0

I think is less positional



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-05 : 05:16:32
Isnumeric is not reliable
http://aspfaq.com/show.asp?id=2390

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -