select 
Author Message
 select

Hi,

I'm having the following problem:
I have got two tables, one is mail_conf the other is http_conf. Both
tables have got the column domain_complete which can have same or
different entries.
I want to get disticnt all domain_complete from both tables.
I tried:
SELECT distinct domain_complete FROM http_conf union SELECT distinct
domain_complete FROM mail_conf.
The Problem is, that when there are equal entries in both tables, I get
them twice and I just want them once.
Can anybody help me, please.

See you
        Matthias

--
-------------------------------------

Homepage: http://www.*-*-*.com/
-------------------------------------



Wed, 19 Feb 2003 23:32:35 GMT  
 select

Quote:
> SELECT distinct domain_complete FROM http_conf union SELECT distinct
> domain_complete FROM mail_conf.

Huh,

Normally this should work.
You also can remove the distinct, cause union by default filters duplicate
ones
Just created a test case to check.
Table1
1
1
2
3
4
5
7

Table2
1
3
5
6
7
8
8

Both

select x from table1;
union;
select x from table2

and

select distinct x from test1;
union;
select distinct x from test2

gave me:
1
2
3
4
5
6
7
8

Greetings,

Ko Wisse
VFP'er
FlexiSoft



Fri, 21 Feb 2003 00:31:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. select in select

2. How to Count Selected Records w/in a SELECT

3. Programmatically selecting items in a multi-select list

4. How can I limit the number of records selected with SELECT - SQL in FPW

5. To select or not to select

6. Selecting in a combo box and buttons being selected behind it

7. Select within a Select

8. How to generate primary keys when selecting items from available listbox to selected listbox

9. select * problem

10. Selecting highlighted item in a Listbox

11. Selecting highlighted item in a Listbox

12. Select Statment problem

 

 
Powered by phpBB® Forum Software