473,587 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join 3 Tables - distinct results

All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacturers have reported in the given month. I know this can be
accomplished through a join, but I need some help. Thanks in advance.

Dave

Jul 19 '05 #1
9 6130
Can you give the table structures? This looks like an interesting one to
try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacturers have reported in the given month. I know this can be
accomplished through a join, but I need some help. Thanks in advance.

Dave

Jul 19 '05 #2
Can you give the table structures? This looks like an interesting one to
try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacturers have reported in the given month. I know this can be
accomplished through a join, but I need some help. Thanks in advance.

Dave

Jul 19 '05 #3
Can you give the table structures? This looks like an interesting one to
try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacturers have reported in the given month. I know this can be
accomplished through a join, but I need some help. Thanks in advance.

Dave

Jul 19 '05 #4
mysql> desc no_report;
+----------------+----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra
|
+----------------+----------------------+------+-----+---------+----------------+
| NRID | smallint(5) unsigned | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------+----------------------+------+-----+---------+----------------+
etc ...

mysql> desc widgets_a;
+----------------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+----------------+
etc ...

mysql> desc widgets_b;
+----------------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+----------------+
etc ...

Brandon wrote:
Can you give the table structures? This looks like an interesting one to
try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacture rs have reported in the given month. I know this can be
accomplishe d through a join, but I need some help. Thanks in advance.

Dave



Jul 19 '05 #5
mysql> desc no_report;
+----------------+----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra
|
+----------------+----------------------+------+-----+---------+----------------+
| NRID | smallint(5) unsigned | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------+----------------------+------+-----+---------+----------------+
etc ...

mysql> desc widgets_a;
+----------------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+----------------+
etc ...

mysql> desc widgets_b;
+----------------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+----------------+
etc ...

Brandon wrote:
Can you give the table structures? This looks like an interesting one to
try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacture rs have reported in the given month. I know this can be
accomplishe d through a join, but I need some help. Thanks in advance.

Dave



Jul 19 '05 #6
mysql> desc no_report;
+----------------+----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra
|
+----------------+----------------------+------+-----+---------+----------------+
| NRID | smallint(5) unsigned | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------+----------------------+------+-----+---------+----------------+
etc ...

mysql> desc widgets_a;
+----------------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+----------------+
etc ...

mysql> desc widgets_b;
+----------------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+----------------+
etc ...

Brandon wrote:
Can you give the table structures? This looks like an interesting one to
try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacture rs have reported in the given month. I know this can be
accomplishe d through a join, but I need some help. Thanks in advance.

Dave



Jul 19 '05 #7
I am going to assume you have a lookup table for the Manufacturer. I'm using
this common table to do the joins from. I also assumed that it will be more
helpfull to see the companyname rather than the ID, if not just change the
select. I created a forth table to test this called manid which has two
fields ID and companyname.

SELECT DISTINCT manid.companyna me
FROM manid LEFT JOIN no_report ON manid.id = no_report.manuf acturerid
LEFT JOIN widgets_a ON manid.id = widgets_a.manuf acturerid
LEFT JOIN widgets_b on manid.id = widgets_b.manuf acturerid
WHERE (no_report.orde rdate >='2003-08-01' AND no_report.order date
<='2003-08-31') OR
(widgets_a.orde rdate >='2003-08-01' AND widgets_a.order date <='2003-08-31')
OR
(widgets_b.orde rdate >='2003-08-01' and widgets_b.order date <='2003-08-31')

Let me know if this produces the desired results.

Brandon

"Dave M" <di******@eswis .net> wrote in message
news:bs******** ***@news.randor i.com...
mysql> desc no_report;
+----------------+----------------------+------+-----+---------+------------
----+ | Field | Type | Null | Key | Default | Extra
|
+----------------+----------------------+------+-----+---------+------------
----+ | NRID | smallint(5) unsigned | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------+----------------------+------+-----+---------+------------
----+ etc ...

mysql> desc widgets_a;
+----------------------------+-------------+------+-----+---------+---------
-------+ | Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+---------
-------+ | id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+---------
-------+ etc ...

mysql> desc widgets_b;
+----------------------------+-------------+------+-----+---------+---------
-------+ | Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+---------
-------+ | id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+---------
-------+ etc ...

Brandon wrote:
Can you give the table structures? This looks like an interesting one to try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacture rs have reported in the given month. I know this can be
accomplishe d through a join, but I need some help. Thanks in advance.

Dave


Jul 19 '05 #8
I am going to assume you have a lookup table for the Manufacturer. I'm using
this common table to do the joins from. I also assumed that it will be more
helpfull to see the companyname rather than the ID, if not just change the
select. I created a forth table to test this called manid which has two
fields ID and companyname.

SELECT DISTINCT manid.companyna me
FROM manid LEFT JOIN no_report ON manid.id = no_report.manuf acturerid
LEFT JOIN widgets_a ON manid.id = widgets_a.manuf acturerid
LEFT JOIN widgets_b on manid.id = widgets_b.manuf acturerid
WHERE (no_report.orde rdate >='2003-08-01' AND no_report.order date
<='2003-08-31') OR
(widgets_a.orde rdate >='2003-08-01' AND widgets_a.order date <='2003-08-31')
OR
(widgets_b.orde rdate >='2003-08-01' and widgets_b.order date <='2003-08-31')

Let me know if this produces the desired results.

Brandon

"Dave M" <di******@eswis .net> wrote in message
news:bs******** ***@news.randor i.com...
mysql> desc no_report;
+----------------+----------------------+------+-----+---------+------------
----+ | Field | Type | Null | Key | Default | Extra
|
+----------------+----------------------+------+-----+---------+------------
----+ | NRID | smallint(5) unsigned | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------+----------------------+------+-----+---------+------------
----+ etc ...

mysql> desc widgets_a;
+----------------------------+-------------+------+-----+---------+---------
-------+ | Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+---------
-------+ | id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+---------
-------+ etc ...

mysql> desc widgets_b;
+----------------------------+-------------+------+-----+---------+---------
-------+ | Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+---------
-------+ | id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+---------
-------+ etc ...

Brandon wrote:
Can you give the table structures? This looks like an interesting one to try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacture rs have reported in the given month. I know this can be
accomplishe d through a join, but I need some help. Thanks in advance.

Dave


Jul 19 '05 #9
I am going to assume you have a lookup table for the Manufacturer. I'm using
this common table to do the joins from. I also assumed that it will be more
helpfull to see the companyname rather than the ID, if not just change the
select. I created a forth table to test this called manid which has two
fields ID and companyname.

SELECT DISTINCT manid.companyna me
FROM manid LEFT JOIN no_report ON manid.id = no_report.manuf acturerid
LEFT JOIN widgets_a ON manid.id = widgets_a.manuf acturerid
LEFT JOIN widgets_b on manid.id = widgets_b.manuf acturerid
WHERE (no_report.orde rdate >='2003-08-01' AND no_report.order date
<='2003-08-31') OR
(widgets_a.orde rdate >='2003-08-01' AND widgets_a.order date <='2003-08-31')
OR
(widgets_b.orde rdate >='2003-08-01' and widgets_b.order date <='2003-08-31')

Let me know if this produces the desired results.

Brandon

"Dave M" <di******@eswis .net> wrote in message
news:bs******** ***@news.randor i.com...
mysql> desc no_report;
+----------------+----------------------+------+-----+---------+------------
----+ | Field | Type | Null | Key | Default | Extra
|
+----------------+----------------------+------+-----+---------+------------
----+ | NRID | smallint(5) unsigned | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------+----------------------+------+-----+---------+------------
----+ etc ...

mysql> desc widgets_a;
+----------------------------+-------------+------+-----+---------+---------
-------+ | Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+---------
-------+ | id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+---------
-------+ etc ...

mysql> desc widgets_b;
+----------------------------+-------------+------+-----+---------+---------
-------+ | Field | Type | Null | Key | Default |
Extra |
+----------------------------+-------------+------+-----+---------+---------
-------+ | id | int(11) | | PRI | NULL |
auto_increment |
| Date | date | YES | | NULL |
|
| ManufacturerID | smallint(6) | YES | | NULL |
|
| NumberUnits | int(11) | YES | | NULL |
|
| ContractNumber | text | YES | | NULL |
|
| OrderDate | date | YES | | NULL |
|
+----------------------------+-------------+------+-----+---------+---------
-------+ etc ...

Brandon wrote:
Can you give the table structures? This looks like an interesting one to try....

"Dave M" <di******@eswis .net> wrote in message
news:rh******** ****@news.rando ri.com...
All

I've got a database that keeps track of sales of widgets. Each company
that belongs to my organiztion is to report their widget sales or no
sales every month.

There are several different types of widgets. Not all companies sell or
report all types of widgets.

We want to report how many companies have reported or not reported their
sales (ie. x companies of a possible y companies have reported sales
this month - y will always be the same - lets say 5).

Because of the way that sales are input, "big widgets" are reported in 2
different tables called widgets_a and widgets_b. If they don't have any
sales to report, they still report and it goes into a table called
no_reports. Each table has a couple of common fields - ManufacturerID
and OrderDate.

I can search all of the tables individually to find if a manufacturer
has reported -

SELECT DISTINCT ManufacturerID FROM widgets_a WHERE OrderDate >=
'2003-06-01' AND OrderDate <= '2003-06-30';

but I want to search through the 3 tables and find how many distinct
manufacture rs have reported in the given month. I know this can be
accomplishe d through a join, but I need some help. Thanks in advance.

Dave


Jul 19 '05 #10

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

Similar topics

0
817
by: Dave M | last post by:
All I've got a database that keeps track of sales of widgets. Each company that belongs to my organiztion is to report their widget sales or no sales every month. There are several different types of widgets. Not all companies sell or report all types of widgets. We want to report how many companies have reported or not reported their
3
3340
by: Ike | last post by:
Oh I have a nasty query which runs incredibly slowly. I am running MySQL 4.0.20-standard. Thus, in trying to expedite the query, I am trying to set indexes in my tables. My query requires four inner joins, as follows : SELECT DISTINCT upcards.id,statuskey.status,upcards.firstname,upcards.lastname,originkey.ori...
4
262
by: Jenni | last post by:
Hi all, Sorry to hassle you with this query, I'm sure the answer is a simple one, but it remains elusive - to me anyway. What I am trying to do is get a query to work. I have a table of people (with ID's) and a table of languages (with People IDs and Language IDs). Now one person may speak many languages. I have put in the relationship....
7
11822
by: Joe | last post by:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource (using Oracle ODBC drivers). After linking the tables in Access, I inspect the data contained in the linked tables. For tables that involve a number field as the primary key, the data is returned successfully. For tables that involve a character field (e.g. CHAR(3) or...
5
3600
by: kumar_rangan1976 | last post by:
I need the below sybase code to be migrated in UDB : select distinct c.partnumber as I_PART, case when d.IntegratorID = 'DCX05' then 'U' when d.IntegratorID = 'DCX04' then 'M' when d.IntegratorID = 'DCX03' then 'E' else ' ' end as 'C_LU_SRCE_PCHSNG', o.SupplierCode as I_SUPLR_LOC,
52
6297
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible variations(combination of fields), - then act on each group in some way ...eg ProcessRs (oRs as RecordSet)... the following query will get me the...
1
5234
by: mcyi2mr3 | last post by:
Hi Help! Im stuck on a join query. Im trying to get distinct (the same row returned only once) user_id and forename from a tbl of users (they are always distinct) where user_id in that tbl equals friend_id in another table friend_id, which 'should' be unique ie there 'should' only be one row of a 'friend connection', but in the case of...
18
5026
by: Dave | last post by:
Guys I am really stuck on this one. Any help or suggestions would be appreciated. We have a large table which seemed to just hit some kind of threshold. They query is somewhat responsive when there are NO indexes on the table. However, when we index email the query takes forever. FACTS - The problem is very "data specific". I can...
1
2215
by: Vivienne | last post by:
Hi there This is a hard problem that I have - I have only been using sql for a couple of weeks and have gone past my ability level quickly! The real tables are complex but I will post a simple and a real version with the hope someone can help me. Any help would be much appreciated - I would also be happy to pay someone to actually do it if...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7974
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5395
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3845
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1192
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.