How to select values from two different tables in SQL

后端 未结 7 1445
醉梦人生
醉梦人生 2021-02-08 16:15

I have two tables in my SQL Server database. The first is Test1 and second is Test2. There is a column RegNo in both tables.

Now I

7条回答
  •  悲哀的现实
    2021-02-08 16:37

    If you are looking foe method without join and relation.This will do the trick.

    select 
       (
       select s.state_name from state s where s.state_id=3
       ) statename,
       (
       select c.description from country c where c.id=5
       ) countryname
       from dual;   
    

    where dual is a dummy table with single column--anything just require table to view

提交回复
热议问题