Skip to content

Tag: left-join

Get one record per ID

I’m trying to retrieve data from 2 tables A&B. , there are multiple data rows in B for each PrimaryKey from A. But I want to get only the first record for every ID from tableA. How can I achieve this? Answer SQL tables represent unordered sets so there is no first row. But you can get an arbitrary r…