Two tables in myschema: post and comment. comment's onId refers to post's is. Among the following two pieces of postgres codes, why select null
in the first piece of codes? what are the differences?
DELETE FROM myschema.comment comment
WHERE NOT EXISTS (
SELECT NULL
FROM myschema.post post
WHERE post.id = comment."onId"
);
DELETE FROM myschema.comment comment
WHERE NOT EXISTS (
SELECT *
FROM myschema.post post
WHERE post.id = comment."onId"
);
Can anyone give some examples to show the differences? Thanks
(postgres is not same with mysql. so my question is not duplicated. I can not tag my question with mysql
, and I always will not search questions tagged with mysql
. That is why I put postgres
in my post title.)