We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to write this kind of query SELECT * FROM tbl WHERE id || id2 IN (SELECT column1 || column2 FROM tbl2 WHERE tbl = 'tbl1')
SELECT * FROM tbl WHERE id || id2 IN (SELECT column1 || column2 FROM tbl2 WHERE tbl = 'tbl1')
Query query = new Query("tbl2") .Select("column1 || column2 ") .Where("tbl", "tbl1"); return new Query("tbl").WhereIn("id || id2", query):
But they don't return any result
The text was updated successfully, but these errors were encountered:
Using SelectRaw can help in this case, Something like this Example on Playground
SelectRaw
var inner = new Query("tbl").SelectRaw("id || id2 as concat_id"); var query = new Query().From(inner, "inner").WhereIn( "concat_id", new Query("tbl2") .SelectRaw("column1 || column2 as col") .Where("tbl", "tbl1") )
will produce
SELECT * FROM ( SELECT id || id2 as concat_id FROM "tbl" ) "inner" WHERE "concat_id" IN ( SELECT column1 || column2 as col FROM "tbl2" WHERE "tbl" = 'tbl1' )
Sorry, something went wrong.
@jeansusgodney I will close this for now, if you have any feedback feel free to reopen it
No branches or pull requests
I am trying to write this kind of query
SELECT * FROM tbl WHERE id || id2 IN (SELECT column1 || column2 FROM tbl2 WHERE tbl = 'tbl1')
But they don't return any result
The text was updated successfully, but these errors were encountered: