Closed scarstens closed 3 years ago
:+1:
Why don't you just query twice and merge two result arrays in PHP?
Because that would create 2 queries? That's not scalable. That seems like a silly answer. That's like asking why MySQL even bothered to build UNION queries.
SQL is a database language, providing many syntaxes to fit many different cases. Medoo is only a simple lightweight library to generate some common SQL queries and adapt different RDBMS. I guess the reason we love it is its simple and easy to use.
Complex queries such as sub-clauses, union, procedures and triggers cannot be described gracefully in medoo's way. Using $medoo->query($sql)
for complex cases should be a better solution.
I disagree, Unions are not complex, they are simple. Thats why I wrote
Unions are pretty simple, SELECT union SELECT. Would it not be possible to union 2 Medoo queries fairly easily?
Also you are not a contributor, that I can tell, why don't you back off and let a contributor respond.
Now, $medoo->select method receives 4 parameters is complex enough.
Also you are not a contributor, you tell them what you are expecting for, I tell them what I am worry about.
$data = $database->query("--complex query--")->fetchAll();
Lol what advantage is there of using medoo for this? lol. The whole point of medoo is to allow query generation though PHP OOP. Why can't you take $medoo_query_builder_1 and union $medoo_query_builder_2?
I'm facing the same problem, and I'm shocked guys. Medoo is a really great and lightweight query builder, but it's kinda sad, that I can't make a union query. I think calling union queries as "complex queries" is a little bit funny tho :)
This is funny and serious I think you should on integrating union into medoo. What is the point of using a database framework without the necessary things like union and others
Why was this issue closed? Is union query now supported? Any example on how unions queries are executed? Thanks
We have been using the Medoo library in our API project. However, today, we attempted to build our Union query between two tables and found out... you cannot do this yet in Medoo.
Unions are pretty simple,
SELECT union SELECT
. Would it not be possible to union 2 Medoo queries fairly easily?