473,406 Members | 2,707 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,406 software developers and data experts.

SQL Query return unused values

I have a table. In the table I have different types of mailing
addresses. The addresses are linked by and ID. ex,

addresses per ID 1
ID address
1 add2
1 add3
1 add4

distinct Addresses in table
ID address
1 add2
1 add3
1 add4

What I am trying to figure out is if this is possible. Is it possible
to figure out some how with a query that in the above example ID 1
is missing add1. I am trying to populate a dropdown list in my code
with just the addresses that are left from the distinct list. I tried
doing an intersect something like this but that did not seem to work.

SELECT type
FROM address_demo
INTERSECT
SELECT type
FROM address_demo AS address_demo_1
WHERE progid = '12954892'

I am wondering if I am moving in the right direction or if this is even
possible......

Thanks

Oct 17 '06 #1
1 1988
i think i might have found a solution that works

SELECT DISTINCT id
FROM address_demo
WHERE (id NOT IN
(SELECT type
FROM address_demo AS
address_demo_1
WHERE (id = @ID)))
ORDER BY type

On Oct 17, 10:30 am, "Chicagoboy27" <jeremy.b...@gmail.comwrote:
I have a table. In the table I have different types of mailing
addresses. The addresses are linked by and ID. ex,

addresses per ID 1
ID address
1 add2
1 add3
1 add4

distinct Addresses in table
ID address
1 add2
1 add3
1 add4

What I am trying to figure out is if this is possible. Is it possible
to figure out some how with a query that in the above example ID 1
is missing add1. I am trying to populate a dropdown list in my code
with just the addresses that are left from the distinct list. I tried
doing an intersect something like this but that did not seem to work.

SELECT type
FROM address_demo
INTERSECT
SELECT type
FROM address_demo AS address_demo_1
WHERE progid = '12954892'

I am wondering if I am moving in the right direction or if this is even
possible......

Thanks
Oct 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Aaron | last post by:
can a method return multiple values? pseudo code public string method1() { //db pull select col1, col2, from tb1 s1 = col1;
16
by: Nikolay Petrov | last post by:
How can I return multiple values from a custom function? TIA
2
by: Cylix | last post by:
Can javascript using pointer or pass variable by reference? Or I need to using object or Array to return the two values? Thanks a lot.
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...
1
by: v4u2chat | last post by:
Do I need to extend any of classes from AXIS to return multiple values? I'm exposing the following method as web service through AXIS to return multiple values. public ContactAddress...
33
by: jayapal | last post by:
Hi all, Is there any way to return two values from a function .................... Thanks, jayapal
2
ADezii
by: ADezii | last post by:
The incentive for this Tip was an Article by the amazing Allen Browne - I considered it noteworthy enough to post as The Tip of the Week in this Access Forum. Original Article by Allen Browne ...
2
by: kkshansid | last post by:
same query return rows in mysql but not on php page while($rs = mysql_fetch_array($sql2)) { $town=$rs; $q="select * from institute where address like '%".$town."%'";//this query //echo $town;...
2
by: Ken Jones | last post by:
Table URL_3 consist of the following 2 columns of information being Record No and URL No URL 1 http:/publishing/45/100006_f.SAL_Local.html 2 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
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.