Skip to content

Tag: sql

Trying to get the 2 min(count()) with Ties

I allow myself to write a thread regarding a query I’m trying to make for hours now. I’m trying to get the name of the friend (friend.first_name) who refuses the most proposed dates for events. To do this I’m counting the number of proposed date and ORDER BY ASC. However, this does not take …

Sql to count m and f based on age [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question i have sql table like this table name: person age gander 21 m 21 m 21 f 22 m 22 f what is q…

Julia: How to get dataframe value into single variable

I am modifying Julia code that I did not write myself. I have worked very little in Julia. I’ve concatenated a string to create a SQL Query that returns a single integer value from the database. I want to use the returned value in the next sql string. However, the value returned from the initial SQL Sel…

Duplicate records in table after left join

I have three tables. “Departments” table: department_name, department_id. Table “LowPrice”: departmend_id, product_name, purchased, sold, price. Table “Basic”: departmend_id, product_name, purchased, sold, price. In the tables “Basic” and “Low” there…

php stop sql query from running every time on refresh

In my php script, I used a sql query to create a table, but after creating the table every subsequent refresh will return an error message stating table is already created. I know its already created but how do I stop query from running a second time on refresh if its already ran? php script: Answer The DDL c…

Take maximum time during update left join mysql

I am doing an update left join on ID and receiver. How can I make the query to pick the record with max time taken? Expected output : Answer I have added another column (id_primary) in right_table. To get the maximum use this subquery (select id_primary from right_table order by time_taken desc limit 1) at en…