473,480 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Distinct values

2 New Member
Hello Friends,

I have two tables like following

Table Name: Company
Company_Entry_ID Company
---------------------------- -------------
<CPY0000001> <Fusion>
<CPY0000002> <MTN>
<CPY0000003> <XPC>

Table Name: Support_Groups
Support_Organization Support_Group Company
------------------------------- --------------------- --------------
<InternalSupport> <ITSupport> <XPC>
<InternalSupport> <EmployeeSupport> <XPC>
<HelpDesk> <ITSupport> <Fusion
<InternalSupport> <CustomerSupport> <Fusion

Now I want the results like following in a separate view

Support_Organization Support_Group Company Company_Entry_ID
------------------------------ --------------------- ------------- ---------------------------
<InternalSupport > <ITSupport> <Fusion> <CPY0000001>
<InternalSupport> <EmployeeSupp> <XPC> <CPY0000003>
<InternalSupport> <CustomerSupp> <Fusion> <CPY0000003>
<HelpDesk> <ITSupport> <Fusion> <CPY0000001>

So in this case what should be the query...

I am asking this b'coz i never worked on Database like this...and frankly I don't know too much about database. I know only select, update, drop etc...

Plz help me, I'll be highly grateful to you people

Thanks in advance
Mar 4 '08 #1
1 1034
deepuv04
227 Recognized Expert New Member
Hello Friends,

I have two tables like following

Table Name: Company
Company_Entry_ID Company
---------------------------- -------------
<CPY0000001> <Fusion>
<CPY0000002> <MTN>
<CPY0000003> <XPC>

Table Name: Support_Groups
Support_Organization Support_Group Company
------------------------------- --------------------- --------------
<InternalSupport> <ITSupport> <XPC>
<InternalSupport> <EmployeeSupport> <XPC>
<HelpDesk> <ITSupport> <Fusion
<InternalSupport> <CustomerSupport> <Fusion

Now I want the results like following in a separate view

Support_Organization Support_Group Company Company_Entry_ID
------------------------------ --------------------- ------------- ---------------------------
<InternalSupport > <ITSupport> <Fusion> <CPY0000001>
<InternalSupport> <EmployeeSupp> <XPC> <CPY0000003>
<InternalSupport> <CustomerSupp> <Fusion> <CPY0000003>
<HelpDesk> <ITSupport> <Fusion> <CPY0000001>

So in this case what should be the query...

I am asking this b'coz i never worked on Database like this...and frankly I don't know too much about database. I know only select, update, drop etc...

Plz help me, I'll be highly grateful to you people

Thanks in advance
Expand|Select|Wrap|Line Numbers
  1. SELECT s.Support_Organization,s. Support_Group,s. Company ,c.Company_Entry_ID
  2. FROM Support_Groups AS S INNER JOIN
  3.      Company AS C ON C.Company = s.Company
  4. order by  s.Support_Organization
  5.  
Mar 4 '08 #2

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

Similar topics

4
6097
by: Florian | last post by:
Hi, I have a table that contains log data, usually around a million records. The table has about 10 columns with various attributes of the logged data, nothing special. We're using SQL Server...
8
7404
by: Richard | last post by:
This is probably easy but I can't work it out. I have this statement SELECT DISTINCT TOP 100 PERCENT dbo.CIF_PlaceReference.Name FROM dbo.CIF_Departures INNER JOIN dbo.CIF_PlaceReference...
8
11082
by: Rich | last post by:
My table looks like this: char(150) HTTP_REF, char(250) HTTP_USER, char(150) REMOTE_ADDR, char(150) REMOTE_HOST, char(150) URL, smalldatetime TIME_STAMP There are no indexes on this table...
5
53328
by: Fred Zuckerman | last post by:
Can someone explain the difference between these 2 queries? "Select Distinct id, account, lastname, firstname from table1" and "Select DistinctRow id, account, lastname, firstname from table1" ...
7
4072
by: Johnathan Doe | last post by:
I can google search to find the range of values that can be represented in a float by reading up on the IEEE std, but is that the same as how many distinct values that can go in a float type? ...
1
1787
by: perspolis | last post by:
Hi everybody is it possible to use Distict sql in DataTable.or DataView.. for example dt.DefaultView.RowFilter="Distinct Code"; ??
5
8727
by: sdowney717 | last post by:
from this, circdate being a datetime field: SQLQuery = "select distinct circdate from circdata order by circdate" I need the distinct date portion excluding the time part. this has come about...
5
6885
by: Daniel Wetzler | last post by:
Dear MSSQL experts, I use MSSQL 2000 and encountered a strange problem wqhile I tried to use a select into statement . If I perform the command command below I get only one dataset which has...
1
3495
newnewbie
by: newnewbie | last post by:
Desperately need help in creating a query to count unique values in a table. I am a Business analyst with limited knowledge of Access….My boss got me ODBC connection to the underlying tables for our...
3
1767
by: Yogesh Sharma | last post by:
I want to select that rollnos which have distinct name & address. create table studento(roll int,name varchar,address varchar(5)) insert into studento values(1,'A','ADD1') insert into studento...
0
7041
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
7081
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
6921
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
5336
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,...
1
4776
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...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.