[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

sql 2005 category number

Posted on 2008-06-12
7
Medium Priority
?
212 Views
Last Modified: 2010-03-19
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

0
Comment
Question by:romeiovasu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 21774403
select * from yoursecondtableinyourexample
where categorynumber = 101010
0
 
LVL 19

Expert Comment

by:elimesika
ID: 21774410
Assuming that the upper table is A and the lower is B

select description fro B where categorynumber  = 101010          
0
 

Author Comment

by:romeiovasu
ID: 21774733
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.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:romeiovasu
ID: 21774737
thanks
0
 
LVL 19

Accepted Solution

by:
elimesika earned 1500 total points
ID: 21776320
HI again

The following solution is more efficient, since it will use your indexes while the solution that you have suggested does a TABLE SCAN
SELECT * FROM arjayiqm.arjaytelecom.dbo.iQclerk_GlobalProducts WHERE categorynumber,6 like '101010%'

Open in new window

0
 
LVL 19

Expert Comment

by:elimesika
ID: 21776329
sorry , paste mistake , it should be :
SELECT * FROM arjayiqm.arjaytelecom.dbo.iQclerk_GlobalProducts WHERE categorynumber like '101010%'

Open in new window

0
 

Author Comment

by:romeiovasu
ID: 21779234
thank you
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question