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
Meeting request change delayed (4.4.7) when sending to more than one outside recipient
Vista stays at Welcome screen
sql stored procedure select compare dates null issue
SQL Server BIT field true and false
get datagridview to show last record instead of first.
Outlook 2003 and Outlook 2007 - No options to accept, decline nor tentative for invitations
Windows XP SP2
Install additional language files on Windows Server 2008 R2
Access 2003 to 2007 customize menu ribbon
Query Question