My database is something like this: I only need the counts of the dates like this: I’ve tried … … but the date format is not my friend. Any ideas would be appreciated. Answer In most databases, you can remove the date component by converting to a date and using group by: However, various dat…
Tag: mysql
Issue with SQL Server select statement
I need help with a select statement that I’m currently struggling with. The scenario is this: select * from mytable WHERE isActive=1 and if only id is provided, select everything where the id=@id if firstname and lastname is provided, then select everything where firstname=@firstname and lastname=@lastn…
Unable to import all values from google sheets to sql
I’m trying to import data from google sheets to mysql. I saved the google sheet as .csv. One of the columns square_feet has very few entries so there are a lot of blank cells. I am unable to import any row which has those blank cells. The error I’m getting is. #1366 – Incorrect integer value…
Replacing certain characters of string in column (MySQL)
I have a table in a MySQL database that features a ‘name’ column with values such as: SDP3973455/1 101390375/2 SDP4608677 105859492/1 104295947 As you can see, some values have the characters ‘SPD’ in front and some values have ‘/1 or /2’ at the end of the string. I want to…
Insert a line with different values
How to insert a line ? position the number 12 piece_color the R id 0 and 1 . I want to have two numbers here I did The returned error was: Answer You need to specify the columns to insert if you would like to use VALUES. In your case, it would be something like this:
How have you set up your database? Do you have to change a lot with a new year? [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 last year. Improve this question I have a question about databases. What does your database actually loo…
How to map data between tables when they are connected by foreign key in mysql?
I have a table for resources which contains resources like case studies, whitepapers, webinars etc. It has one to many relationship with another table case_study_blocks. So there is a foreign key caseStudyId in the case_study_blocks table, which points to case studies in the resources table. I want to move al…
Creating specific size
I have a table in html.I want to add that table with php on my database. The problem is with my table. I have done that I have 24 positions and that I want to give in my table that those 24 are that size,not 25 and going on..Second,I have B and R that it is the color (It is
What could be the possible drawbacks of using force index clause in mysql query? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question Sample Example – SELECT * FROM table_name FORCE INDEX (index_list) WH…
mysql order by field row display even if empty
I’ve two tables( bom and bom_parts). Need to inner join and display stock_deduct,GRN_id,part_id fields. Table 1 (bom): Table 2 (bom_parts): MySql query: Query Result: Expected Result: Even if the part_id field is empty in this case 8, 6, I just want to display the part_id with the stock_deduct field as …