Link to home
Start Free TrialLog in
Avatar of romeiovasu
romeiovasu

asked on

sql 2005 category number

i have a get a result where it shows the top category like

cellularaccessories motorola faceplate ki krzr
i am looking only for cellular accessories how can i get that.

my data structure is like this
CategoryNumber CategoryName
101010		CellularAccessories
10101010	         FacePlates
1010101010	FaceplatesAM
101020		cellcards
10102010	         cellcards1
1010201010	cellcardsam
 
 
gpid	pidentifier	categorynumber	description
3013	CAFPMI000054	1010101010	MOTOROLA FACEPLATE K1 KRZR
3171	CAFPTM000063    1010201010	productcellcaram1
3172	CAFPTM000066    1010201020	productcellcaram2
3173	CAFPTM000067    1010201020	productcellcaram3

Open in new window

Avatar of chapmandew
chapmandew
Flag of United States of America image

select * from yoursecondtableinyourexample
where categorynumber = 101010
Assuming that the upper table is A and the lower is B

select description fro B where categorynumber  = 101010          
Avatar of romeiovasu
romeiovasu

ASKER

sorry i got the query by myself the query is
SELECT * FROM arjayiqm.arjaytelecom.dbo.iQclerk_GlobalProducts WHERE LEFT(categorynumber,6) = '101010'

so i am not allocating any points for anybody.
thanks
ASKER CERTIFIED SOLUTION
Avatar of elimesika
elimesika
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry , paste mistake , it should be :
SELECT * FROM arjayiqm.arjaytelecom.dbo.iQclerk_GlobalProducts WHERE categorynumber like '101010%'

Open in new window

thank you