Adophilus
Explore posts from serversIs it possible to get the total count while fetching rows in a single query?
I have a query which looks like this:
I noticed that the 'count' only counts the result of the query and not all the rows in the table. Is it possible to make it to count all the rows in the table?
I'm using PG
9 replies
Join + Nested Object
I everyone 👋 . Before I ask my question, I know that there's already another question with the exact same title. I went through it hoping to find a solution there but to no avail. I'm trying to do the exact same thing as him (join two tables but join one as a property under the other table.
The two tables in question here are
lodges
and lodge_conditions
. I just wanna make a query such that I'll get back something of the type
without having to perform 2 separate queries.
Here's what I've tried so far:
But it's giving me the following error:
Database: MariaDB (MySQL) 10.6.1
5 replies
MySQL Returning Statement Alternative
A while back I read online that MySQL does not support RETURNING statements at all. If that's the case how do I handle a situation in which I insert a new row and then get the inserted row back? Do I depend on the row being inserted to have some unique identifier I can use to fetch it after insertion or is there another way (in the event in which the only unique id is the primary key -- which is autogenerated)
21 replies