Search for a word

I would like to retrieve the word from the following file

filename abc.txt
------------------------------------------------------------------
Deadlock Id 28418: Process (Familyid 0, Spid 140) was waiting for a 'exclusive intent' lock on the 'request_copy_hist' table in database 4 b
ut process (Familyid 34, Spid 34) already held a 'exclusive table' lock on it.
Deadlock Id 28419: Process (Familyid 0, Spid 90) was waiting for a 'exclusive page' lock on page 57863937 of the 'testrslt' table in databas
e 4 but process (Familyid 65, Spid 65) already held a 'exclusive page' lock on it.
Deadlock Id 28419: Process (Familyid 0, Spid 65) was waiting for a 'shared page' lock on page 57891433 of the 'orders' table in database 4
but process (Familyid 90, Spid 90) already held a 'exclusive page' lock on it.
Deadlock Id 28420: Process (Familyid 0, Spid 90) was waiting for a 'exclusive page' lock on page 57863937 of the 'testrslt' table in databas
e 4 but process (Familyid 65, Spid 65) already held a 'exclusive page' lock on it.
Deadlock Id 28420: Process (Familyid 0, Spid 65) was waiting for a 'shared page' lock on page 57891433 of the 'upload' table in database 4
but process (Familyid 90, Spid 90) already held a 'exclusive page' lock on it.
Deadlock Id 28421: Process (Familyid 0, Spid 90) was waiting for a 'exclusive page' lock on page 57863937 of the 'testrslt' table in databas
e 4 but process (Familyid 65, Spid 65) already held a 'exclusive page' lock on it.
Deadlock Id 28421: Process (Familyid 0, Spid 65) was waiting for a 'shared page' lock on page 57891433 of the 'testrslt' table in database 4
but process (Familyid 90, Spid 90) already held a 'exclusive page' lock on it.
Deadlock Id 28422: Process (Familyid 0, Spid 65) was waiting for a 'shared page' lock on page 61234188 of the 'testrslt' table in database 4
but process (Familyid 90, Spid 90) already held a 'exclusive page' lock on it.
-------------------------------------------------------------------

my expected output:
--------------------
'request_copy_hist'
'testrslt'
'order'
'testrslt'
'upload'
'testrslt'
'testrslt'
'testrslt'

All the word is followed by "table in database", but in different column number. So I have no idea how to use awk or other method to do it.

Thank you very much

cat filename | sed 's/table in database.*$//g'| awk '{print $NF }'

Maybe you could use a different field separator.

awk -F "'" '/table in database/ { print $4 }' abc.txt

There are many different awk implementations; if yours is very old, see if you have nawk or mawk or gawk or XPG4 awk (search the forums if you need help with that).