Presently i am using this query
select top 10 productname from prpducts where productname like 'go%'
result:
Gold & Ivory Coloured Regal Bedspread
Gold & Ivory Duvet Set
Gold & Ivory Quilted Bedspread
Gold / Nickel Finished Christmas Bells
Gold / Silver Melting Furnace
Gold /Platinum Crucibles and Moulds for X-ray Fluorescence Analysis
Gold and Carat Balances with Electronic Anti-theft Code
Gold and Diamond Finger Rings
Gold And Diamond Jewellery
Gold And Red Colored Hindu Wedding Cards
But problem is ,i want different results
like
gold................
goat........
godrej.......
goods........
gown........
go nogo.........
gong.........
govia.........
god ganes........
golf...........
etc
so,please tell me the query format
Loading
Vilas GitePosted Jul 2, 2011, 3:21 AM
SELECT top 10 productname FROM products WHERE productname like 'go%' ORDER BY productname DESC
SELECT top 10 productname FROM products WHERE productname like 'go%' ORDER BY productname ASC
http://www.c-sharpcorner.com/UploadFile/73ba73/8026/?ArticleID=d9e599b2-ae4a-4412-b9b1-1f92c53efc9d
----------------------------------------------------------------------------------------------------
If this reply hepls your post…then "MARK AS ANSWER"!
praveen rapelliPosted Jun 30, 2011, 3:06 AM
this is the query:
SELECT top 10 productname FROM products WHERE productname like 'go%'
RESULT:
gold & Ivory Coloured Regal Bedspread
gold & Ivory Duvet Set
gold & Ivory Quilted Bedspread
gold / Nickel Finished Christmas Bells
gold / Silver Melting Furnace
gold /Platinum Crucibles and Moulds for X-ray Fluorescence Analysis
gold and Carat Balances with Electronic Anti-theft Code
gold and Diamond Finger Rings
gold And Diamond Jewellery
gold And Red Colored Hindu Wedding Cards
But problem is ,my products table having 900 records when i execute
SELECT productname FROM products WHERE productname like 'go%'
But i am execute first query ,all the products name comes with 'gold',but
in my table different types of product name are available starting with 'go%'
here i am mentioning some examples
gold................
goat........
godrej.......
goods........
gown........
go nogo.........
gong.........
govia.........
god ganes........
golf...........
etc
i want top 10 productnames in different manner starting with 'go%'
because i have to implement this in autocomplete for my site
Suthish NairPosted Jun 30, 2011, 2:29 AM
praveen rapelliPosted Jun 30, 2011, 2:01 AM
i want different product names starting with 'go',as shown above
Suthish NairPosted Jun 30, 2011, 1:54 AM