Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8392429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:31:06+00:00 2026-06-09T19:31:06+00:00

I need to create a view for with resulting math function multiply. Is this

  • 0

I need to create a view for with resulting math function multiply. Is this possible?

Table:

mysql> show create table devices \G
Create Table: CREATE TABLE `devices` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `d_type` varchar(255) NOT NULL,
  `multiplier` char(255) NOT NULL DEFAULT '',
  `value` decimal(10,3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

Sample rows:

mysql> SELECT devices.id, devices.d_type, devices.multiplier, devices.`value`  FROM devices;   
+----+--------------------------+------------+--------+
| id | d_type                   | multiplier | value  |
+----+--------------------------+------------+--------+
|  1 | Cisco Call Manager       | /          |  4.000 |
|  2 | Generic Router/Switch    | *          |  0.350 |

I need to somehow calculate using the multiplier to provide a result for various math.
Example (not working of course):

SELECT devices.id, devices.d_type, devices.multiplier, devices.`value`, (SELECT 1 $multiplier devices.`value`) as EPS FROM devices; 

The result in this case should be:

+----+--------------------------+------------+--------+--------+
| id | d_type                   | multiplier | value  |   EPS  |
+----+--------------------------+------------+--------+--------+
|  1 | Cisco Call Manager       | /          |  4.000 |  0.25  |
|  2 | Generic Router/Switch    | *          |  0.350 |  0.35  |

we need to derive the EPS column by dividing or multiplying 1 by the value column.
Is there a way to use that multiplier as a determination of whether to divide or multiply?

(note that I used 1 as an example, this could be any incoming integer from user input)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:31:08+00:00Added an answer on June 9, 2026 at 7:31 pm

    You can use this query

    SELECT devices.id, devices.d_type, devices.multiplier, devices.`value`, IF(multiplier = '/', 1/value, 1*value) as EPS FROM devices;
    

    it works for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATED: I am using MySQL statement to create a view: I need to show
I need to create a view or a table valued function that returns one
I need to create a view that show employees that have their Service anniversary
I need to create a view like below. Not sure what this view called.
I want to create list view just like this: http://dl.maximumpc.com/galleries/androidpower/Alarm_full.jpg I need to create
I need a solution for this. I need to create a view model for
I need to create a view with a column that indicates which table does
I need to create a View that represents an x/y axis. I will read
I need to create a custom view, which extends RelativeLayout and simply needs to
In my app, I create view controller objects as I need them. When a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.