0
I have 2 tables in which one is inserted the records that comes from a file txt
and the other the records that comes from a file excel
.
With this, I need to delete the records from the table txt
containing in the table excel
, in case the same.
Only that there are files in the table txt
starting with 0 and in the table excel
no, and the system does not understand as equal and does not exclude.
How can I also delete records that contain 0 at the beginning ?
My delete is like this:
DELETE
TEMP_IMPORTACAO_TXT
FROM
TEMP_IMPORTACAO_TXT TXT
INNER JOIN
TEMP_IMPORTACAO_EXCEL EX
ON
TXT.CAMPO = EX.CAMPO
May or may not contain 1 or more 0 to the left?
– DH.
How can a field have zero left in a database? The type is text(varchar,car...)?
– mau humor
Only 1 zero left. @DH.
– AndreeH
@user5978 is varchar type
– AndreeH
Regardless of the language, when you have two values represented as string, and you want to make a "numerical" comparison between these values, you should use a "CAST". Sqlserver implements this: http://blog.sqlauthority.com/2007/07/07/sql-server-convert-text-convert-to-numbers-integer-cast-and-convert/. I know they will answer your question, but please consider doing so.
– mau humor