Skip to content
Advertisement

Tag: mysql

Why did I sum the wrong result?

I’d like to have an advice for this SUM that doesn’t work as expected. I have to SUM data from the same day and display it in a table. I did a query like this: This is the ‘simple’ one and it displays every single row, I have to put a SUM in it to make it show every day

Suggestion for a contact management database design

I am currently designing a contact management database for a chamber of commerce. The goal of the database is to store all the person (except our own staff), all recorded companies (regular companies and member of the chamber), addresses of the person and companies, tasks that the staff are currently responsible for, a list of our staff (user) and the

MySQL script triggers Error #1241

I have the script below, which is supposed to get a price for an array of ID’s that has been provided. But it needs to get 1 price per ID, and the tricky part is, that I want to have the ability to have scheduled price updates. This mean that it needs to take the price that is <= UTC_TIMESTAMP

MySQL aggregated sum of JSON objects

I have created new table and having details as JSON datatype. I tried to get the aggregated sum of all records. I can able to get the each values but I don’t know how to get the sum using group by …

Importing certain columns from csv into mysql via command line

I have a csv file and want to import part of it into my Mysql database. From this question, I tried this command in my Mysql command line Those in bracket is the columns I want to put in my table. The order is same to my table but not same to csv file. And the mysql didn’t do anything

SQL Query Confused

Display: account no. customer id initial amount in terms of lakhs (rounded off to 2 decimals) [change the column heading to ‘INITIALAMTIN_LAKHS’] amount category(amt < 50000 show as 'Low', amt > …

java.sql.SQLException: Geometry byte string must be little endian

I want to use the contains function to get all values whose title or question contains a certain value. However, I get this error: java.sql.SQLException: Geometry byte string must be little endian. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120) at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2076) at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1932) at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3426) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:488) at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3131) at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2299) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2722) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322) at SQL.Select.getRecentQuestions(Select.java:447) at org.apache.jsp.Questions_jsp._jspService(Questions_jsp.java:198)

Order by SQL line

How would I go about creating an SQL line that puts each car from new to old (Years) but also keeps it in alphabetical order For example it needs to do this This is how its displaying MY View Answer You may try the following query: The call I make to SUBSTRING_INDEX extracts the second word from the model string.

Advertisement