SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 select address
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

funketekun
Constraint Violating Yak Guru

Australia
491 Posts

Posted - 08/04/2006 :  10:38:27  Show Profile  Visit funketekun's Homepage  Reply with Quote
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)

Singapore
17437 Posts

Posted - 08/04/2006 :  10:39:16  Show Profile  Reply with Quote
select top 1 address
from addresses
order by address



KH

Go to Top of Page

funketekun
Constraint Violating Yak Guru

Australia
491 Posts

Posted - 08/04/2006 :  10:44:05  Show Profile  Visit funketekun's Homepage  Reply with Quote
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)

Singapore
17437 Posts

Posted - 08/04/2006 :  10:48:20  Show Profile  Reply with Quote
then define what do you mean by "first address"


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 08/04/2006 :  11:26:25  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Where Address in ('All your Addresses')

Madhivanan

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

funketekun
Constraint Violating Yak Guru

Australia
491 Posts

Posted - 08/04/2006 :  13:03:28  Show Profile  Visit funketekun's Homepage  Reply with Quote
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

Sweden
29910 Posts

Posted - 08/04/2006 :  13:42:18  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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 - 08/04/2006 :  18:16:19  Show Profile  Reply with Quote
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

India
22713 Posts

Posted - 08/05/2006 :  05:16:32  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Isnumeric is not reliable
http://aspfaq.com/show.asp?id=2390

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000