Giter Site home page Giter Site logo

While joining two tables if some columns have same name then I am not able to select all column names (Only all unique column names are displaying in the output). about nocodb HOT 3 CLOSED

shivsharma396 avatar shivsharma396 commented on April 28, 2024
While joining two tables if some columns have same name then I am not able to select all column names (Only all unique column names are displaying in the output).

from nocodb.

Comments (3)

o1lab avatar o1lab commented on April 28, 2024

Having multiple keys with same name in an object wouldn't work.

Fixed Output will be in the lines of -

Expected Output:
[{
u_id: 1,
u_name : "xxx",
c_id: 1,
c_name : "city1"
},{
u_id : 2,
u_name : "yyy",
c_id: 2,
c_name : "city2"
}]

where alias for tables' getting joined - u and c will be appended with _ to each column name.

from nocodb.

o1lab avatar o1lab commented on April 28, 2024

@shivsharma396 Commit 5a9b6f4 has the fix and this will go in next release of npm.

Query:

/api/xjoin?_join=u.user,_lj,c.city&_on1=(u.city_id,eq,c.id)&_fields=u.id,u.name,c.id,c.name

Response:

[{
u_id: 1,
u_name : "xxx",
c_id: 1,
c_name : "city1"
},{
u_id : 2,
u_name : "yyy",
c_id: 2,
c_name : "city2"
}]

With this commit, _fields query param will be mandatory wherein earlier all fields of tables in join were getting selected.

from nocodb.

o1lab avatar o1lab commented on April 28, 2024

Solution in 0.4.4

from nocodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.