How to create database view for 2 tables

Tharun_M
Tera Contributor

Hello everyone,

 

I'm new to database view.

 

I have two tables

 

Table1 extends task

Table1 has 2 fields 

field1 - String (Example. Phone)

field2 - Reference to table2 (Example. Samsung)

 

Table2 does not extend any table

Table2 has 2 fields 

field1 - String(this is the reference record used in table1) (Example. Samsung)

field2 - String(Example. note 15)

 

Is there any way where I could see field1, field2 of table1 and field1 field2 of table2. (Phone Samsung Samsung Note 15) using database view?

1 ACCEPTED SOLUTION

Danish Bhairag2
Tera Sage
Tera Sage

@Tharun_M ,

 

In ur case when u create database view based upon prefix wht u provide it should look something like below

 

You should write this in where clause of table 2

 

Lets say prefix u have kept is table1 & table2

 

Then ur where clause would look like

table1.field2=table2.sys_id

 

Thanks,

Danish

View solution in original post

8 REPLIES 8

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Tharun_M ,

 

Pls see below video for step by step process 

 

https://youtu.be/2Hlns3wBtWk?si=2Ut3ukeRRTQ3Kffa

 

Thanks,

Danish

Danish Bhairag2
Tera Sage
Tera Sage

@Tharun_M ,

 

In ur case when u create database view based upon prefix wht u provide it should look something like below

 

You should write this in where clause of table 2

 

Lets say prefix u have kept is table1 & table2

 

Then ur where clause would look like

table1.field2=table2.sys_id

 

Thanks,

Danish

Hi Danish,

Thank you so much. I worked like a magic. The mistake I was doing was table1.field2=table2.field2.

 

Thanks a lot!

@Tharun_M Happy to help & Happy Learning 🙂

 

Thanks,

Danish