Skip to content

Tag: sql

SQL Select only last row’s username

I got my db and I only want to get my last row’s username. The database is named servers and the table is log: As I mentioned I’m trying to get this: Output: borat I tried using: But I’m only getting the correct timestamp and not the right username, and my output is also way longer than what…

Issue with uploading image using this.form.submit();

I am using this.form.submit(); in order to upload an image straight after it is sellected and also pass some other info along. I am having an issue, the submit works and passes the id with post but the image is not uploaded and the name is not inserted in the db it might add a name like 0_ but that

Column to see Completion

I’m trying to come up with a way to add an extra column to this result-set that is a bit value of 1/0if the particular owner has all the rows as not null. The column would be: Answer You can use window functions:

how to query the max value of count

I try to get the max count value but error this is my data I need to get the max count of tool_id I use this code to get tool_count and I use to get max tool_count but it error the result I need : Answer You can try using order by desc with limit 1