Search
 
SCRIPT & CODE EXAMPLE
 

SQL

t-sql update table variale

UPDATE @searchResult
SET [record_id] = r.[record_id], 
    [record_name] = r.[record_name]
FROM @searchResult SR
CROSS APPLY (
    SELECT TOP 1 *
    FROM [records]
    WHERE [record_name] LIKE [name_template]   -- Your wish, but do you really need LIKE matching??
    ORDER BY [record_id] DESC
) AS r;
Comment

PREVIOUS NEXT
Code Example
Sql :: create relationship with betwen two tables in postgersql 
Sql :: mysql add 24 hours to datetime 
Sql :: value of sold product using having and group by in sql 
Sql :: how to see table associated with a schema in sql 
Sql :: convert db timestamp to date 
Sql :: requete sql mise a jour content dans un colone mysql 
Sql :: AND Operator (AND) 
Sql :: What are the advantages of MySQL when compared with Oracle? 
Sql :: qt qsql check if table exist 
Sql :: how to get employee having maximum experience in mysql 
Sql :: How to calculate average of average salary of departments? 
Sql :: sql varchar(255) 
Sql :: how to drop check constraint in sql 
Sql :: what is unsigned mysql 
Sql :: except in sql alchemy 
Sql :: Patch Applied to the Oracle Database 
Sql :: mysql let join 
Sql :: create darabase in sql 
Sql :: dump only schema 
Sql :: procedure excute monthly oracle 
Sql :: SQL FULL OUTER JOIN With AS Alias 
Sql :: psql use query result convert Decimal python numpy psycopg2 
Sql :: transaction in java mysql 
Sql :: C# get column name of sqlreader 
Sql :: apikey in pl sql 
Sql :: case when with count and combining similar values in sql 
Sql :: oracle connection 
Sql :: tsql table column constraint must be uppercase 
Sql :: mysql exception output 
Sql :: bidirectional outer join sql 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =