In microsft access I got a table with fields username and ip
I want to select all rows that their ip addresses starts with 37.255.
I tried this but it didnt work:
select sheet1.username , sheet1.ip from sheet1 where sheet1.ip like '37.255.*'
Thanx in advance
By "I tried this but it didnt work:" you mean, you get no records back?
The SQL syntax looks good to me. Did you define [ip] as a text field? The LIKE clause would not work, if [ip] was a number.
Related
What I am trying to do
https://i.stack.imgur.com/QzsCT.png
SELECT message, "Need to add user here"
FROM database WHERE source="Device Thresholds"
You could create another table with possible responses, based on your question. Joining your table with "message" in one table and joining it with another table with "possible responses" may work.
Something like this would be ok but cant get the syntax correct
SELECT message, SUBSTRING(message,7,6)
FROM database WHERE source="Device Thresholds"
Where the number 6 is for number of characters I would like to find part of the srting as number of charachters which in my case would be "' "
SELECT message, SUBSTRING(message,7,find("' ",message))
FROM database WHERE source="Device Thresholds"
But this brings back an error
I'm having issue with my study project for creating database in MySQL.
I've imported data using LOAD to my created table from a CSV file. Now when I'm executing select * from mytable everything show up perfectly, but when I execute select * from bi_jogging.routes as r where r.Creator_Email="jhenderson7c#bbb.org"
I get nothing.
The email is there, I've tried different syntax options but it seems to be something else, I suspect something with the varchar format, I really have nothing in mind.
For other tables it works fine and others not.
You can try using the query:
select * from bi_jogging.routes as r where r.Creator_Email like "%jhenderson7c#bbb.org%"
If like operator shows the result then there may be white spaces in the email, please double check..
For join try this:
select * from bi_jogging.routes as r join bi_jogging.buddies as b
on b.Email like '%r.Creator_Email%'
I think it should work. Again check with same code.
select * from bi_jogging.routes as r where r.Creator_Email='jhenderson7c#bbb.org'
if [select * from mytable] this works ,then try to copy the email from result and paste it in where clause.
There may be conflicts between quotes.
your table entry contains quotes???
check properly. i think you have quotes in your table entry,so when you try this,
select * from bi_jogging.routes as r where r.Creator_Email like "%jhenderson7c#bbb.org%"
'%' sign matches with any character and you will get the result.
Inside the tablejhenderson7c#bbb.org and "jhenderson7c#bbb.org" are completely different.
I found spaces in the mysql tables after few emails, so I guess that was it. burned 8 hours on this one, thank you all. I could not find the spaces at the end of the mail by looking at it, I had to hit backspace to see that only after two hits the last char is deleted
this helped me : UPDATE bi_jogging.results set Mail_Found = TRIM(Replace(Replace(Replace(Mail_Found,'\t',''),'\n',''),'\r',''));
mysql php admin table query enter image description here
I don't see why it says partID is giving me a problem? it is in the table and i think i have them linked correctly. I Have changed a few things i replaced comma with the and statement which cleared up alot of my errors. But since I've done that it continues to give me #1305 - FUNCTION homeshopping.partID does not exist. I have even looked at the structures an designer to make sure column names an tables are correct.
Don't forget to post your query as text also.
Because it's missing the keywork IN to have a query like this:
SELECT CONCAT(hscust.first,' ', hscust.last AS Customer,hsitems.description,hsitems.price,hsitems.itemCalss
FROM hscust,hsorders,hslineitem,hsitems
WHERE hslineitems.orderId = hsorders.orderId AND hsitems.partID = hslineitem.partNum AND hslineitem.price = hsitems.price AND partID IN ('CB03', 'CZ82');
I have 100 email address in my mysql table and its look like abc#xy.com, fdgf#xy.com, ghfe#xy.com, erekke#xyz.com,tty#xyz.com, ere#xy.com, ect.... I need to change all #xy.com to #xyz.com using mysql query.
Please help me for query
Thanks in advance!
You can try this:
update myTable
set email = replace(email, '#xy.com', '#xyz.com')
where email like '%#xy.com'
I am trying to update a field in a MySQL table of around 4,000 records where the email
addresses matches about 90 email addresses.
I have looked through past answers and tried to get it right but seem to be getting more errors.
I am using phpMyAdmin and this is what I first started off with:
UPDATE `user_table`.`eb_users` SET `pause` = 'X' WHERE `eb_users`.`email` LIKE ('test1#test1.com', 'another#another.com', 'moreemail#email.com');
The above throws the "Operand should contain 1 column(s) error" - I then tried different
variants of the above and got similar errors.
It's probably basic but am just not getting it... any help appreciated
If you know all of the email addresses you need to match then you can look for matches against a collection using IN rather than LIKE
UPDATE `user_table`.`eb_users` SET `pause` = 'X' WHERE `eb_users`.`email` IN ('test1#test1.com', 'another#another.com', 'moreemail#email.com');