Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Unpredicted behaviour i IN clause

Unpredicted behaviour i IN clause

Scheduled Pinned Locked Moved Database
questionhelpdatabase
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qur
    wrote on last edited by
    #1

    Please see my problem below: Table structure: tmpItemPrice(ItemPriceID bigint not null , Thickness varchar(255)) Row1 ItemPriceID: 1 Thickness: xyz Select ItemPriceID From tmpItemPrice Where IsNumeric(Thickness) = 1 and Cast(Thickness as float) <= 0 When above query runs it give my type conversion error which is logical as Thickness is not numeric. But when we use this query in IN clause as shown below it works fine. select * from tmpItemPrice Where ItemPriceID in ( Select ItemPriceID From tmpItemPrice Where IsNumeric(Thickness) = 1 and Cast(Thickness as float) <= 0 ) So my question are: - what is the reason behind it? - Is it right to use it in this way? Thanks

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups