| | |
Question about SELECT statement
Please support our MS SQL advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2005
Posts: 92
Reputation:
Solved Threads: 0
I have one table in this format:
now I want to display product which components meet requested items, for example:
I know component are "part1" and "part3", need to show product name (that is "A").
How can I do that in SQL statement?
Thanks.
Product Component --------------------------- A part1 A part2 B part1 B part4 A part3 C part5 D part1
now I want to display product which components meet requested items, for example:
I know component are "part1" and "part3", need to show product name (that is "A").
How can I do that in SQL statement?
Thanks.
SQL Syntax (Toggle Plain Text)
SELECT Product FROM Table WHERE Component IN ('part1','part3')
Last edited by cgyrob; Jul 16th, 2009 at 6:53 pm.
cgyrob's response was what you asked for. What is your real goal here? Or are we not understanding your problem correctly?
If you really want an 'AND' use an 'AND'
SQL Syntax (Toggle Plain Text)
SELECT Product FROM Table WHERE Component = 'part1' AND Component ='part3'
![]() |
Similar Threads
- Question about SELECT statement (MS SQL)
- Question about select statement (MySQL)
- Question about SELECT statement (MySQL)
- Question about SELECT statement. (MySQL)
- Getting current value in Select Statement (MS SQL)
- Program Problem with a select statement to access Data base (C)
Other Threads in the MS SQL Forum
- Previous Thread: How to open Master Database File(.mdf)
- Next Thread: Aspx page wont search a database
| Thread Tools | Search this Thread |
autogrowth connectingtodatabaseinuse count cursor data database datepart dbsize deadlock delete_trigger highperformancecomputing hpc hpcserver2008 ibm iis loop maximum microsoft ms mssql multithreading news number permission query reporting result server services sets source sql sqlserver sqlserver2005 supercomputing uniqueid update view






