Solved

sql 2005 category number

Posted on 2008-06-12
7
175 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
  • 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:romeiovasu
ID: 21774737
thanks
0
 
LVL 19

Accepted Solution

by:
elimesika earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

805 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