Skip to content

Tag: sql

How do I load values in txt file to mysql table colum

I have value like this stored in value.txt file I have created table in the below way I am unable to find a way to insert the txt file details in payload columnn of table. I saw load option is there but it is more of entire table oriented. I want the txt files value to be in specific column.

MySQL – Sum revenue while correcting by daily exchange rates

I have two tables Orders table Exchange rates table (cron-job does the job for this) I have to sum the orders total in USD and with the correct exchange rate! How could I achieve that? Is there a common practice? What I have so far is a basic sum: Answer The link you need is that based on the date.

Oracle query, get count of records by hour

I am trying to get transaction counts for every hour. Normally it is a straight forward query by unfortunately the timestamp column I have to work with is not timestamp but varchar2! No matter what I try I get either “not a valid month” or “invalid number”, depending on the format I us…

Obtain Name Column Based on Value

I have a table that calculates the number of associated records that fit a criteria for each parent record. See example below: note – morning, afternoon and evening are only weekdays What I am trying to achieve is to determine which columns have the lowest value and get their column name as such: Here i…

How to find the sum from value of sql column

I have two tables with following data. studenttbl: feetbl: I need to find below data, but I am not getting balance value of seatno 1006: I am using this SQL query: Please help me with this. Answer This issue is due to INNER JOIN versus LEFT JOIN. When you INNER JOIN youll only get matches between two tables. …