How to show values on my query? [Resolved]

Posted by Raghuldrag under Sql Server on 11/6/2014 | Points: 10 | Views : 402 | Status : [Member] | Replies : 1
Hi Friends ,
in my table i ve the column of item code which contains '1000' ,'2000' ,'3000' series i jus wanna display the output of item codes '1000','2000'series and some of ('3000019','3000020','3000077','3000078').

i tried left(itemcode,4) in ('1000','2000') or itemcode in ('3000019','3000020','3000077','3000078')
in join query its taking so much of time how t o solve ?




Responses

Posted by: Bandi on: 11/6/2014 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
use the below condition and check the execution time
itemcode like '1000%' or itemcode like '2000%'
or itemcode in ('3000019','3000020','3000077','3000078')


if you have index on this column itemcode, the above query somewhat improves retrieval process

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raghuldrag, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response