Select Rows with id having even number

0 votes

I'm passing a straightforward query that looks for particular rows where OrderID is an even number.

SELECT * 
FROM Orders 
WHERE mod(OrderID,2) = 0;

Error :

Syntax error (missing operator) in query expression 'mod(OrderID,2) = 0'.

Can someone please help me solve this? 

Aug 21, 2022 in Database by Kithuzzz
• 38,000 points
2,264 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Use the modulus operator:

SELECT * FROM Orders where OrderID % 2 = 0;

The MOD() function exists in Oracle, which is the source of your confusion. I hope this helps you.

answered Aug 22, 2022 by narikkadan
• 63,600 points

edited Mar 5
0 votes

Try this one,

SELECT * 
FROM Orders
WHERE Orders%2=0

answered Mar 30, 2024 by mouleidi_dwi

edited Mar 5

Related Questions In Database

0 votes
0 answers

Select rows with same id but different value in another column

I've read numerous threads and tried for ...READ MORE

Aug 12, 2022 in Database by Kithuzzz
• 38,000 points
1,906 views
0 votes
1 answer

How will I get all the rows from my table where name starts with 's' and ending with 'I'?

Hi Santanu, I understand your problem, You can try ...READ MORE

answered May 28, 2019 in Database by sampriti
• 1,120 points
2,241 views
0 votes
1 answer

Number of rows affected by an UPDATE in PL/SQL

You can try using the following query: SELECT ...READ MORE

answered Feb 14, 2022 in Database by Vaani
• 7,070 points
1,475 views
0 votes
1 answer

Maximum number of rows of CSV data in excel sheet

The maximum number of characters per cell ...READ MORE

answered Apr 6, 2022 in Database by gaurav
• 23,260 points
9,009 views
0 votes
1 answer

Convert Number to Words in Indian currency format with paise value

Use this code and check  <?php /** ...READ MORE

answered Apr 11, 2022 in Database by gaurav
• 23,260 points
8,164 views
0 votes
0 answers

PL/SQL ORA-01422: exact fetch returns more than requested number of rows

I am getting this error: DECLARE * ERROR at line ...READ MORE

Aug 19, 2022 in Database by Kithuzzz
• 38,000 points
1,287 views
0 votes
1 answer

Function vs. Stored Procedure in SQL Server

Functions are calculated values that cannot make ...READ MORE

answered Feb 17, 2022 in Database by Neha
• 9,020 points

edited Feb 17, 2022 by Neha 19,524 views
0 votes
1 answer

Calculate Time Intersection to Correlate Sequences of Independent Events

I think this solution requires a CROSS JOIN implementation. ...READ MORE

answered Oct 26, 2018 in Power BI by Upasana
• 8,620 points
900 views
0 votes
1 answer

How do I UPDATE from a SELECT in SQL Server?

MERGE INTO YourTable T USING ...READ MORE

answered Feb 3, 2022 in Database by Vaani
• 7,070 points
944 views
0 votes
0 answers

How do I UPDATE from a SELECT in SQL Server?

INSERT INTO Table (col1, col2, col3) SELECT col1, ...READ MORE

Feb 4, 2022 in Database by Vaani
• 7,070 points
626 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP