473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Query multiple fields in same table.

Table looks like this:

Expand|Select|Wrap|Line Numbers
  1. custno custname qty active banner
My simple query so far looks like this:

Expand|Select|Wrap|Line Numbers
  1. /****** Script for SelectTopNRows command from SSMS  ******/
  2. SELECT ALL[custno]
  3.       ,[custname]
  4.       ,[qty]
  5.       ,[active]
  6.       ,[banner]
  7.   FROM [mydatabase].[dbo].[subscribe]
  8.   WHERE qty > 1 AND active = 1 AND banner = '99'
I have a total of nine banners eg. 13, 06, 18, etc

How would I choose to display the results of several banners of my choosing? Thank you in advance. Peter
Nov 17 '11 #1
2 2056
ck9663
2,878 Expert 2GB
Join the table to itself. Just use a different alias for each.

Happy Coding!!!


~~ CK
Nov 17 '11 #2
Thank you for the prompt reply. Much appreciated. As a noob, all I have to do now is figure out how to implement your suggestion. Have a good one! Peter
Nov 17 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: andri.wardhana | last post by:
Hi Guys, I have a problem with my ASP file. since I'm all new in ASP, i found that the error statement generated by ASP is confusing. basically what I want to do in this script is ability to...
1
by: keliie | last post by:
I have a relatively simple (I assume) issue which I am at a complete loss to address. My issues is: I want to populate fields in my tables with summary data from the same table. Let me explain: ...
3
by: mkjets | last post by:
I have worked for hours on trying to find a solution and have not figured it out. I am working in Access 2003. I need to create a query that takes values from 1 table and displays them in...
4
by: 663scott | last post by:
Hi I have the following table in a database: Name: Table 1 Field 1: Account ID Field 2: FILM ID 1 Field 3: FILM ID 2 Field 4: FILM ID 3
0
by: Howie | last post by:
Hi all. Hope you can help. I occasionally need to enter info directly into a table. However, when I do, I often need to enter the same value into a large number of fields. It would be nice if...
3
GrandMaster
by: GrandMaster | last post by:
Hi all I'm using MS Access 97 and in my current database (a flat single table database) I have a field for FirstName and one for FamilyName. I've been given two different lots of data to import...
1
by: rickzh | last post by:
Please help me creatng a query I've got 1 table called PRODUCT containing all my hardwareitems Some hardwareitems belongs to another hardwareitem. For example a monitor belongs to a PC. There could...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
3
by: dontfwithchuck | last post by:
Hi, this is my first post. I use Access XP. I have a single table called Movies containing the following fields: ID, Title, Genre, Rating, Location, Date I want a datasheet with the Titles...
3
by: Bigdaddrock | last post by:
I have a form that allows for input of new Customer Billing address fields (B1, B2, B3) as well as fields for the Shipping Address (S1, S2, S3). Sometimes these are the exact same! I have text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.