ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

Need help -> SQL Problem


  • Please log in to reply
Need help -> SQL Problem

#1

Skully2018
Skully2018
    Offline
    16
    Rep
    962
    Likes

    Veteran

Posts: 1648
Threads: 244
Joined: Feb 02, 2018
Credits: 0

Six years registered
#1

Hello... I need your help with a SQL problem :)

I created a small table to illustrate it :)

I would like to filter out the entries that do NOT have CST as a time zone.

Then only 3 (Jacky) would be left.

The value “0” should then be written in the “Visible” column.
 

 ID | Name         | Language  | Country | Time Zone  | Phone      | Visible | Date
----+--------------+-----------+---------+------------+------------+---------|---------
 01 | John Smith   | German    | Germany |     UTC    | +49 xxxxxx |    1    | 12/09/24
----+--------------+-----------+---------+------------+------------+---------|---------
 02 | Lou Vega     | German    | Spain   |     UTC    | +32 xxxxxx |    1    | 23/01/99
----+--------------+-----------+---------+------------+------------+---------|---------
 03 | Jacky Brown  | Turkiye   | Ukrain  |     CST    | +21 xxxxxx |    1    | 25/01/22
----+--------------+-----------+---------+------------+------------+---------|---------
 04 | Monica L.    | Island    | China   |     UTC    | +77 xxxxxx |    1    | ß1/01/01
----+--------------+-----------+---------+------------+------------+---------|---------
....

I tried it with:
 

UPDATE [User_DB] SET [visible]=0 WHERE [TimeZone] NOT LIKE '%CST%';

I tried it, but somehow I can't get any further.

Maybe someone is into SQL Fit and can give me a solution :)

Thanks in advance ;)

Cheers
 


  • 0

-= I'm allergic to stupidity, it makes me break out in a rash of sarcasm =-

 

-+-+-+-+-+-+-+-+-+-+-+-

 

View my Uploads !!!


-+-+-+-+-+-+-+-+-+-+-+-

Sorry but most of my uploads up to mid 2021 have been deleted by Mega.nz !!!
In most cases, I have a newer version for you ;)


#2

RandomBoyz
RandomBoyz
    Offline
    0
    Rep
    11
    Likes

    Advanced Member

Posts: 87
Threads: 6
Joined: Jan 01, 2018
Credits: 0

Six years registered
#2

Hello... I need your help with a SQL problem :)

I created a small table to illustrate it :)

I would like to filter out the entries that do NOT have CST as a time zone.

Then only 3 (Jacky) would be left.

The value “0” should then be written in the “Visible” column.
 

 ID | Name         | Language  | Country | Time Zone  | Phone      | Visible | Date
----+--------------+-----------+---------+------------+------------+---------|---------
 01 | John Smith   | German    | Germany |     UTC    | +49 xxxxxx |    1    | 12/09/24
----+--------------+-----------+---------+------------+------------+---------|---------
 02 | Lou Vega     | German    | Spain   |     UTC    | +32 xxxxxx |    1    | 23/01/99
----+--------------+-----------+---------+------------+------------+---------|---------
 03 | Jacky Brown  | Turkiye   | Ukrain  |     CST    | +21 xxxxxx |    1    | 25/01/22
----+--------------+-----------+---------+------------+------------+---------|---------
 04 | Monica L.    | Island    | China   |     UTC    | +77 xxxxxx |    1    | ß1/01/01
----+--------------+-----------+---------+------------+------------+---------|---------
....

I tried it with:
 

UPDATE [User_DB] SET [visible]=0 WHERE [TimeZone] NOT LIKE '%CST%';

I tried it, but somehow I can't get any further.

Maybe someone is into SQL Fit and can give me a solution :)

Thanks in advance ;)

Cheers
 

Did you manage to fix it?


  • 0

#3

Skully2018
Skully2018
    Offline
    16
    Rep
    962
    Likes

    Veteran

Posts: 1648
Threads: 244
Joined: Feb 02, 2018
Credits: 0

Six years registered
#3
UPDATE deine_tabelle
SET Visible = 0
WHERE "Time Zone" != 'CST';

thats it :)


  • 0

-= I'm allergic to stupidity, it makes me break out in a rash of sarcasm =-

 

-+-+-+-+-+-+-+-+-+-+-+-

 

View my Uploads !!!


-+-+-+-+-+-+-+-+-+-+-+-

Sorry but most of my uploads up to mid 2021 have been deleted by Mega.nz !!!
In most cases, I have a newer version for you ;)



 Users browsing this thread: