Skip one row inside request using inner join (sql compact server 4.0)
0
votes
2
answers
650
views
I am using SQL server compact 4.0 and VB.net and Visual studio 2019.
I am using this request to extract information from 4 tables : Table0, Table1, Table2 and Table3.
This request is working fine before, but now I have one problem because one column in Table 3 (ID_C) is now duplicated, and this request needs table 3 without this duplication.
One solution for my problem is to create a new table (table 3 without duplication) and the problem will be solved. But I am thinking because I am beginner in SQL, maybe there is a solution to skip one row in Table3 inside the request. I have searched, but I didn't find a solution for this problem.
"SELECT Table0.M " +
"FROM Table1 INNER JOIN " +
"Table2 ON Table1.ID = Table2.ID_V INNER JOIN " +
"LM ON Table2.ID_M = Table0.ID_M INNER JOIN " +
"Table3 ON Table2.ID_C = Table3.ID_C " +
"WHERE (Table1.IDX_V = #IDX_V#) AND (Table3.ID_C = '#ID_C#')"
In the code #IDX_V# and #ID_C# are replaced by some values.
Asked by all.west
(3 rep)
Oct 1, 2021, 03:12 PM
Last activity: Oct 3, 2021, 01:25 AM
Last activity: Oct 3, 2021, 01:25 AM