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.
| Author |
Topic |
|
sevdej
Starting Member
2 Posts |
Posted - 2009-11-18 : 02:10:28
|
| Hi friends,I am developer .I am making a project .I need phone brand model using useragent. I have a table for this. My Input is useragent like this. 'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN76' my table columns are brand, model,useragent. I am using this arguments and return brand and model . How am I write a query ? Thank you. sevdeh |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
sevdej
Starting Member
2 Posts |
Posted - 2009-11-18 : 02:26:55
|
| I have useragent columns in table. I need compare this useragents and return brand and model. I am writing a query but it is very slow . my query is DECLARE @brand varchar(50), @model varchar(50)SELECT TOP 1 @brand = Brand, @model = Model FROM PHONE_MODEL WHERE @useragent LIKE '%' + UserAgent + '%' ORDER BY DIFFERENCE(UserAgent, @useragent) DESC;IF @@ROWCOUNT = 0 BEGIN -- no info for phone model RETURN '?'; END-- returning brand model RETURN @brand + ' ' + @model;sevdeh |
 |
|
|
|
|
|