I want to show name of the record in select, but I need to send only id of that record. My code: Answer You can send selected value in option
Tag: mysql
Trouble with outer join coupled with search coupled with group by
I am trying to do 2 things with a query. 1) Return the ticket subject from one table and the matching messages from another table. This is a one to many relationship and I want the return to show the subject with all the messages for each subject concatenated. 2) be able to search against the subject as well …
How the db model should be for this scenario? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I’m modeling a database scenario but I’m not understandin…
Mysql Mariadb recursive query
I have the following table : and a recursive query on it : which works and prints the following result : I would have liked to add an extra column to the result, namely “parent_name”. How do I do this? Edited to add: https://stackoverflow.com/a/22376973/2027239 That was the answer on an older ques…
ORDER BY num-rows of another table
I have to create a ranking of the directors who have made the most reviews. What is the method for reordering according to the number of rows in another table? Table 1 (director) Table 2 (employee_reviews) Result (Directors ranking): Answer You need to join to your table and select the count when (ON) the aut…
MySQL query to find values in table with given value and find others that are similar
I have a table called followers and I want to be able to find the current users followers, display that list, and then compare those values against another user ID to see if they are following them or not from that same table This is the table I’m using currently to get the list of followers for a speci…
SQL Query to return filters applicable to products contained in category AND filters that apply from remaining products once 1+ filters active
I’m displaying a list of product filters. Product filters are only displayed if they are applicable to the products contained within a chosen category. I want to expand that further so once a filter …
SQL groups inside groups
I have transaction data like this example: Name | Price George | 20 George | 20 George | 20 George | 30 Paul | 20 Paul | 20 Paul | 30 Paul | 30 Paul | 35 I need to group by …
python sql insert statement inserting values with quotes in database
I am trying to insert data into Mysql in python using the below statements Here id =”75″, plantcode=”2″, pcode=”FG” But my values in database are inserted with single quote in mysql database i.e ’75’,’2′,’FG’ I do not why the values are i…
How to get student attendance_status by date using sql query?
In my database I have this data. Now I want to query and fetch data based on date and group by roll_number. I am able to fetch all the data using But I am not able to find what I want. I am learning databases and SQL. I used group by option like below but my result is not what