Microsoft
Software
Hardware
Network
Question : Select min value from multiple tables
Lets say I have 4 tables all with different loc_id values(10,15,20,10). How do I select the min value found in all 4 tables.
select min(loc_id) from table1
select min(loc_id) from table2
select min(loc_id) from table3
select min(loc_id) from table4
Results:
1| 10
--------
1| 15
--------
1| 20
-------
1|10
what I would like is 1 row with the value:10
Answer : Select min value from multiple tables
SELECT MIN(locID) from
(
select min(loc_id) locid from table1
union
select min(loc_id) from table2
union
select min(loc_id) from table3
union
select min(loc_id) from table4 )A
Random Solutions
Type of conditional expression cannot be determined because there is no implicit
Word frequency counter without Full text index
.Net v1.1 Website Problem
Hyper-V- server 2008 R2 - Windows server backup supported?
Obtain the latest date in SQL datatable using vb.net 2005
How do I get content aligned corectly in a WPF Combobox
A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
Setting a trigger when a specific column is updated?
How to limit query to top n records
How to Create query from selction made in a drop down list.Acees 2007