“Like” operator in inner join in SQL [on hold]











up vote
-3
down vote

favorite












SELECT COUNT(comment_id) 
FROM tbl_comment c
WHERE superior_id LIKE '%' + account_id + '%'
AND 'account_id' NOT IN (
SELECT superior_id
FROM tbl_comment_reply
WHERE comment_id=c.comment_id;


this query returned error like




Query : SELECT COUNT(comment_id) FROM tbl_comment c WHERE superior_id LIKE '%' + account_id + '%' AND 'account_id' NOT IN (SELECT super...
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ account_id + '%' AND 'account_id' NOT IN (SELECT superior_id FROM tbl_comment_' at line 1
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000











share|improve this question









New contributor




athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH 18 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    There's no joins in that... why do you mention one in your title? (PS: Count your parenthesis).
    – Shawn
    18 hours ago






  • 2




    You have a bracket missing from your SQL - was that accidental copy paste error or is it missing from the original?
    – slugster
    18 hours ago










  • Did you really intend to check the literal string 'account_id' for being in a list of values, or did you intend to check the contents of the account_id column?
    – Caius Jard
    17 hours ago










  • account_id used at like operator is variable?
    – DPS
    17 hours ago






  • 1




    MySQL doesn't have a concat operater (|| in Standard SQL, + in SQL Server), it's using concat instead: 'concat(%', account_id, '%'). And AND 'account_id' should be AND account_id without quotes
    – dnoeth
    16 hours ago

















up vote
-3
down vote

favorite












SELECT COUNT(comment_id) 
FROM tbl_comment c
WHERE superior_id LIKE '%' + account_id + '%'
AND 'account_id' NOT IN (
SELECT superior_id
FROM tbl_comment_reply
WHERE comment_id=c.comment_id;


this query returned error like




Query : SELECT COUNT(comment_id) FROM tbl_comment c WHERE superior_id LIKE '%' + account_id + '%' AND 'account_id' NOT IN (SELECT super...
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ account_id + '%' AND 'account_id' NOT IN (SELECT superior_id FROM tbl_comment_' at line 1
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000











share|improve this question









New contributor




athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH 18 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    There's no joins in that... why do you mention one in your title? (PS: Count your parenthesis).
    – Shawn
    18 hours ago






  • 2




    You have a bracket missing from your SQL - was that accidental copy paste error or is it missing from the original?
    – slugster
    18 hours ago










  • Did you really intend to check the literal string 'account_id' for being in a list of values, or did you intend to check the contents of the account_id column?
    – Caius Jard
    17 hours ago










  • account_id used at like operator is variable?
    – DPS
    17 hours ago






  • 1




    MySQL doesn't have a concat operater (|| in Standard SQL, + in SQL Server), it's using concat instead: 'concat(%', account_id, '%'). And AND 'account_id' should be AND account_id without quotes
    – dnoeth
    16 hours ago















up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











SELECT COUNT(comment_id) 
FROM tbl_comment c
WHERE superior_id LIKE '%' + account_id + '%'
AND 'account_id' NOT IN (
SELECT superior_id
FROM tbl_comment_reply
WHERE comment_id=c.comment_id;


this query returned error like




Query : SELECT COUNT(comment_id) FROM tbl_comment c WHERE superior_id LIKE '%' + account_id + '%' AND 'account_id' NOT IN (SELECT super...
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ account_id + '%' AND 'account_id' NOT IN (SELECT superior_id FROM tbl_comment_' at line 1
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000











share|improve this question









New contributor




athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











SELECT COUNT(comment_id) 
FROM tbl_comment c
WHERE superior_id LIKE '%' + account_id + '%'
AND 'account_id' NOT IN (
SELECT superior_id
FROM tbl_comment_reply
WHERE comment_id=c.comment_id;


this query returned error like




Query : SELECT COUNT(comment_id) FROM tbl_comment c WHERE superior_id LIKE '%' + account_id + '%' AND 'account_id' NOT IN (SELECT super...
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ account_id + '%' AND 'account_id' NOT IN (SELECT superior_id FROM tbl_comment_' at line 1
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000








mysql sql






share|improve this question









New contributor




athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 18 hours ago









Barbaros Özhan

10.6k71430




10.6k71430






New contributor




athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 18 hours ago









athulya

1




1




New contributor




athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






athulya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH 18 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH 18 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Barbaros Özhan, Joakim Danielson, Madhur Bhaiya, mickmackusa, AdrianHHH

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    There's no joins in that... why do you mention one in your title? (PS: Count your parenthesis).
    – Shawn
    18 hours ago






  • 2




    You have a bracket missing from your SQL - was that accidental copy paste error or is it missing from the original?
    – slugster
    18 hours ago










  • Did you really intend to check the literal string 'account_id' for being in a list of values, or did you intend to check the contents of the account_id column?
    – Caius Jard
    17 hours ago










  • account_id used at like operator is variable?
    – DPS
    17 hours ago






  • 1




    MySQL doesn't have a concat operater (|| in Standard SQL, + in SQL Server), it's using concat instead: 'concat(%', account_id, '%'). And AND 'account_id' should be AND account_id without quotes
    – dnoeth
    16 hours ago
















  • 1




    There's no joins in that... why do you mention one in your title? (PS: Count your parenthesis).
    – Shawn
    18 hours ago






  • 2




    You have a bracket missing from your SQL - was that accidental copy paste error or is it missing from the original?
    – slugster
    18 hours ago










  • Did you really intend to check the literal string 'account_id' for being in a list of values, or did you intend to check the contents of the account_id column?
    – Caius Jard
    17 hours ago










  • account_id used at like operator is variable?
    – DPS
    17 hours ago






  • 1




    MySQL doesn't have a concat operater (|| in Standard SQL, + in SQL Server), it's using concat instead: 'concat(%', account_id, '%'). And AND 'account_id' should be AND account_id without quotes
    – dnoeth
    16 hours ago










1




1




There's no joins in that... why do you mention one in your title? (PS: Count your parenthesis).
– Shawn
18 hours ago




There's no joins in that... why do you mention one in your title? (PS: Count your parenthesis).
– Shawn
18 hours ago




2




2




You have a bracket missing from your SQL - was that accidental copy paste error or is it missing from the original?
– slugster
18 hours ago




You have a bracket missing from your SQL - was that accidental copy paste error or is it missing from the original?
– slugster
18 hours ago












Did you really intend to check the literal string 'account_id' for being in a list of values, or did you intend to check the contents of the account_id column?
– Caius Jard
17 hours ago




Did you really intend to check the literal string 'account_id' for being in a list of values, or did you intend to check the contents of the account_id column?
– Caius Jard
17 hours ago












account_id used at like operator is variable?
– DPS
17 hours ago




account_id used at like operator is variable?
– DPS
17 hours ago




1




1




MySQL doesn't have a concat operater (|| in Standard SQL, + in SQL Server), it's using concat instead: 'concat(%', account_id, '%'). And AND 'account_id' should be AND account_id without quotes
– dnoeth
16 hours ago






MySQL doesn't have a concat operater (|| in Standard SQL, + in SQL Server), it's using concat instead: 'concat(%', account_id, '%'). And AND 'account_id' should be AND account_id without quotes
– dnoeth
16 hours ago



















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Bressuire

Vorschmack

Quarantine