hadleigh

SQL: Select records from a table

Discussion created by hadleigh on Apr 25, 2017
Latest reply on Apr 26, 2017 by hadleigh

Greetings All

 

I am looking to add a line into the following code to select only records that match the following criteria

  • I have a variable set called: $additional_settings
  • The field that needs to match with $additional_settings is called _kf_uuid_companys

the code that i have already is as follows, i need to add a line into this code to pick records where the field _kf_uuid_companys matches $additional Settings.

Any help would be greatly appreciated:

 

"SELECT " & $dyn_sql & ", '" & $$record_delimiter & "'" & " FROM \\"" & $sync_table & "\\"" & " WHERE " &

// Exclude records flagged for sync exclusion. "( COALESCE ( BS_Exclude, 0 ) = 0 ) " &

// If the client is merging new/updated data with data already on the device... // Only include records that have been added/updated since the last pull... // And only include data that they did not just push (i.e. no "round tripping!")... If ( ( $$sync_method = "Merge" ) and ( $last_pull_utc > 0 ); "AND ( BS_UTC_Time > " & $last_pull_utc & " ) " & "AND ( COALESCE ( BS_Device_ID, 'X' ) <> '" & $client_persistent_id & "') "; "" )

Outcomes