Jump to content

Distinct Value but return different column.


This topic is 2810 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am trying to get a list of UIDs from a select for Distinct CatalogNumber WHERE Tech = TechName

 

UID

CatalogNumber

Tech

 

Just can't seem to get the syntax right.

Link to comment
Share on other sites

What does your full statement look like? 

 

Try this: 

SELECT (Distinct X),OtherColumn FROM tableName WHERE Tech = TechName
Link to comment
Share on other sites

Thanks, tried that one but that gives me two columns in the results

 

The UID is unique by nature. 

 

I want all the CatalogsNumbers by a Tech 

 

0111-TS,1556,Joe
0111-TS,1557,Joe
0111-TS,1558,Joe
0777-TS,1559,Joe
0777-TS,1560,Joe
0744-TS,1780,Joe
0744-TS,1820,Joe
 
The goal would be
 
1556
1559
1780
Link to comment
Share on other sites

I'm not sure of a way to do exactly what you're asking, but here's a few options...

 

If you're able to get the data you need, but are just trying to get rid of that extra column of data, you may be able to use ColumnSlice: https://github.com/jbante/FileMaker-Techniques/blob/63b4ffdf518a1016aae9665e2d1818f26788b886/CustomFunctions/SQL/ColumnSlice.fmfn

 

Alternatively, I suspect a Fast Summaries type of method would be quicker:

  1. Perform find by Tech
  2. Sort by CatalogNumber
  3. Go to first record
  4. Loop:
    1. Save UUID to a $list
    2. $nextGroup = Table::summaryCountId + Get ( RecordNumber )
    3. Exit Loop If $nextGroup > Get ( FoundCount )
    4. Go to record by number [$nextGroup]
Link to comment
Share on other sites

This topic is 2810 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.